mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Rename Core to Base (Closes #3733).
This commit is contained in:
parent
29b0200f62
commit
9db93e5d8f
156 changed files with 303 additions and 302 deletions
52
src/base/filesystemwatcher.h
Normal file
52
src/base/filesystemwatcher.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
#ifndef FILESYSTEMWATCHER_H
|
||||
#define FILESYSTEMWATCHER_H
|
||||
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QDir>
|
||||
#include <QTimer>
|
||||
#include <QPointer>
|
||||
#include <QStringList>
|
||||
#include <QHash>
|
||||
|
||||
/*
|
||||
* Subclassing QFileSystemWatcher in order to support Network File
|
||||
* System watching (NFS, CIFS) on Linux and Mac OS.
|
||||
*/
|
||||
class FileSystemWatcher : public QFileSystemWatcher
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FileSystemWatcher(QObject *parent = 0);
|
||||
~FileSystemWatcher();
|
||||
|
||||
QStringList directories() const;
|
||||
void addPath(const QString &path);
|
||||
void removePath(const QString &path);
|
||||
|
||||
signals:
|
||||
void torrentsAdded(const QStringList &pathList);
|
||||
|
||||
protected slots:
|
||||
void scanLocalFolder(QString path);
|
||||
void scanNetworkFolders();
|
||||
void processPartialTorrents();
|
||||
|
||||
private:
|
||||
void startPartialTorrentTimer();
|
||||
void addTorrentsFromDir(const QDir &dir, QStringList &torrents);
|
||||
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
static bool isNetworkFileSystem(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;
|
||||
};
|
||||
|
||||
#endif // FILESYSTEMWATCHER_H
|
Loading…
Add table
Add a link
Reference in a new issue