diff options
author | Arno <am@disconnect.de> | 2013-09-03 06:12:33 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-09-03 06:12:33 +0200 |
commit | 130e0a3115cd66e38ec57846e06f69e7fd284400 (patch) | |
tree | dd2a1cd7eaa32d1f515ec45bdc009e7cbbb354aa /smdirmodel.h | |
parent | 3f0a819948d36d06f1ddf07e5a51ff771ddda4da (diff) | |
download | SheMov-130e0a3115cd66e38ec57846e06f69e7fd284400.tar.gz SheMov-130e0a3115cd66e38ec57846e06f69e7fd284400.tar.bz2 SheMov-130e0a3115cd66e38ec57846e06f69e7fd284400.zip |
Switch to QRunnable + QThreadPool
Get rid of SmDataCollector and do its job in small, QRunnable tasks and
let QThreadPool manage the treads.
Works well with a local Filesystem. Yet to see how it works over
networked Filesystems.
Ah, before I forget: NEVER, EVER USE QPixmap in THREADS -> Random
crashes! (Yes, I know, it's documented...)
Diffstat (limited to 'smdirmodel.h')
-rw-r--r-- | smdirmodel.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/smdirmodel.h b/smdirmodel.h index 02ad608..26f34cf 100644 --- a/smdirmodel.h +++ b/smdirmodel.h @@ -9,6 +9,7 @@ #define SMDIRMODEL_H #include <QDir> +#include <QSqlDatabase> #include <smtreemodel.h> #include <smdirwatcher.h> @@ -31,17 +32,18 @@ class SmDirModel : public SmTreeModel { virtual QVariant data(const QModelIndex &index, int role) const; virtual bool setData(const QModelIndex &index, const QVariant &value, int role); bool isDir(const QModelIndex &idx) const; - SmDataColletor *collector() const { return mCollector; } QDir dir() const; QFileInfo fileInfo(const QModelIndex &idx) const; - QTimer *refresTimer() { return mRefreshTimer; } + QTimer *refreshTimer() { return mRefreshTimer; } public slots: void setDir(const QString &dir); void dirEvent(const QList<QVariant> &data, int e); void readSettings(); void refresh(); - void setCheckForPresent(bool check); + void setMd5Sum(QString path, QString md5); + void setFfmpeg(QString path, QVariantMap data); + void setPicSize(QString path, QVariant data); private slots: void populate(SmTreeItem *root); @@ -56,12 +58,10 @@ class SmDirModel : public SmTreeModel { SmDirWatcher *mWatch; QStringList mHeaders; QString mCurrentDir; - QString mCur; QTimer *mRunTimer; QTimer *mRefreshTimer; QMap<QString, QIcon> mIcons; - QMutex *mCollectorMx; - SmDataColletor *mCollector; + QSqlDatabase mDb; }; class TimerHandler { |