Refactor functions in FileSystemWatcher

Use c++11 range-loop
Add const
Better ifdef placement
Inline functions
This commit is contained in:
Chocobo1 2018-03-14 10:59:33 +08:00
parent 0840556f77
commit 61eddfce90
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
2 changed files with 52 additions and 86 deletions

View file

@ -56,22 +56,23 @@ signals:
void torrentsAdded(const QStringList &pathList);
protected slots:
void scanLocalFolder(QString path);
void scanNetworkFolders();
void scanLocalFolder(const QString &path);
void processPartialTorrents();
#ifndef Q_OS_WIN
void scanNetworkFolders();
#endif
private:
void startPartialTorrentTimer();
void addTorrentsFromDir(const QDir &dir, QStringList &torrents);
void processTorrentsInDir(const QDir &dir);
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
static bool isNetworkFileSystem(QString path);
static bool isNetworkFileSystem(const QString &path);
#endif
#ifndef Q_OS_WIN
QList<QDir> m_watchedFolders;
QPointer<QTimer> m_watchTimer;
#endif
QStringList m_filters;
// Partial torrents
QHash<QString, int> m_partialTorrents;
QPointer<QTimer> m_partialTorrentTimer;