Sayonara Player
FileSystemWatcher.h
1 #ifndef FILESYSTEMWATCHER_H
2 #define FILESYSTEMWATCHER_H
3 
4 #include <QThread>
5 #include <QStringList>
6 #include "Helper/Set.h"
7 
8 class FileSystemWatcher : public QThread
9 {
10  Q_OBJECT
11 
12 signals:
13  void sig_changed();
14 
15 public:
16  FileSystemWatcher(const QString& library_path, QObject* parent);
17  void refresh();
18  void stop();
19 
20 protected:
21  void run() override;
22 
23 private:
24  QStringList _indexed_files;
25  QString _library_path;
26  bool _may_run;
27  bool _refresh;
28  bool _waiting;
29 
30  QStringList index_files(const QString& root);
31 };
32 
33 #endif // FILESYSTEMWATCHER_H
Definition: FileSystemWatcher.h:8