From 034d71dce3ba7ab4dacb130b6766beabddbe2b4d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 21 Nov 2017 18:23:39 +0800 Subject: [PATCH] Wrap function into anonymous namespace --- src/base/bittorrent/torrentcreatorthread.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/base/bittorrent/torrentcreatorthread.cpp b/src/base/bittorrent/torrentcreatorthread.cpp index bfa8ca83e..c8d19c16e 100644 --- a/src/base/bittorrent/torrentcreatorthread.cpp +++ b/src/base/bittorrent/torrentcreatorthread.cpp @@ -35,8 +35,8 @@ #include #include #include -#include #include +#include #include @@ -44,16 +44,19 @@ #include "base/utils/misc.h" #include "base/utils/string.h" +namespace +{ + // do not include files and folders whose + // name starts with a . + bool fileFilter(const std::string &f) + { + return !Utils::Fs::fileName(QString::fromStdString(f)).startsWith('.'); + } +} + namespace libt = libtorrent; using namespace BitTorrent; -// do not include files and folders whose -// name starts with a . -bool fileFilter(const std::string &f) -{ - return !Utils::Fs::fileName(QString::fromStdString(f)).startsWith('.'); -} - TorrentCreatorThread::TorrentCreatorThread(QObject *parent) : QThread(parent) , m_private(false)