summaryrefslogtreecommitdiffstats
path: root/smdirwatcher.h
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-03-20 21:27:35 +0100
committerArno <am@disconnect.de>2013-03-20 21:27:35 +0100
commit03831d3669ea49a99a15aaf5d17724be8c533b85 (patch)
tree618e3fe63b0430a4dbe604153ab588eb811fd183 /smdirwatcher.h
parent457e5328c8fbbf236fb163e90d732a35a583fd2d (diff)
downloadSheMov-03831d3669ea49a99a15aaf5d17724be8c533b85.tar.gz
SheMov-03831d3669ea49a99a15aaf5d17724be8c533b85.tar.bz2
SheMov-03831d3669ea49a99a15aaf5d17724be8c533b85.zip
Use a Thread for collecting file data
blocking the GUI isn't nice, so use a separate Thread to gather all the data for SmDirModel. Populating and changing directory works, but modifying a file is most likely broken.
Diffstat (limited to 'smdirwatcher.h')
-rw-r--r--smdirwatcher.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/smdirwatcher.h b/smdirwatcher.h
index 0da5b4b..3167aeb 100644
--- a/smdirwatcher.h
+++ b/smdirwatcher.h
@@ -10,6 +10,11 @@
#include <QThread>
#include <QMutex>
+#include <QList>
+#include <QVariant>
+#include <QFileInfo>
+
+class SmTreeItem;
class SmDirWatcher : public QThread {
Q_OBJECT
@@ -33,4 +38,31 @@ class SmDirWatcher : public QThread {
QString mCurrent;
};
+class SmDataGatherer : public QThread {
+ Q_OBJECT
+ public:
+ explicit SmDataGatherer(const int numFields, QObject *parent = 0);
+ void setCurrent(const QString &current, int mode = -1);
+
+ public slots:
+ void run();
+ //void setFile(const QString &fullPath, int event);
+ //void populate(const QString &dir);
+
+ signals:
+ void newData(const QList<QVariant>,int);
+ void population(SmTreeItem*);
+ void needRefresh();
+
+ private:
+ //QList<QList<QVariant> > populate();
+ SmTreeItem *populate();
+ const QList<QVariant> fileData(const QFileInfo &fi) const;
+ QString mCurrent;
+ QMutex mRunMx;
+ QMutex mSetMx;
+ int mMode;
+ const int mNumFields;
+};
+
#endif // SMDIRWATCHER_H