QXRD  0.11.16
qxrdfilebrowsermodelupdater.h
Go to the documentation of this file.
1 #ifndef QXRDFILEBROWSERMODELUPDATER_H
2 #define QXRDFILEBROWSERMODELUPDATER_H
3 
4 #include "qcepobject.h"
5 #include <QFileSystemWatcher>
6 #include <QTimer>
7 #include <QDateTime>
8 #include <QFileInfo>
9 #include <QVector>
11 #include "qxrdfilebrowsermodel.h"
12 
13 class QxrdFileBrowserModelUpdater : public QcepObject, public QEnableSharedFromThis<QxrdFileBrowserModelUpdater>
14 {
15  Q_OBJECT
16 public:
19 
20  bool updateNeeded();
21 
22 public slots:
23 // void shutdown();
24  void changeRoot(const QString &path);
25  void changeContents(const QString &path);
26  void updateTimeout();
27  void needUpdate();
28  void updateContents();
29  void generateFileUpdates(int doIt);
30 
31 private:
33  QString m_RootPath;
34  QFileSystemWatcher *m_FileSystemWatcher;
35  QAtomicInt m_UpdateNeeded;
36  QTimer m_UpdateTimer;
38  QVector<QFileInfo> m_Directories;
39  QVector<QFileInfo> m_Files;
40  QDateTime m_PreviousUpdate;
41  QAtomicInt m_GenerateUpdates;
42 };
43 
44 #endif // QXRDFILEBROWSERMODELUPDATER_H
void changeContents(const QString &path)
QxrdFileBrowserModelUpdater(QxrdFileBrowserModelWPtr browser, QcepObject *parent)
QxrdFileBrowserModelWPtr m_BrowserModel
QWeakPointer< QxrdFileBrowserModel > QxrdFileBrowserModelWPtr