From 3adf6f859dd4d5df8e8fceacce74487814867e61 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 7 Dec 2014 22:40:10 +0100 Subject: Major revamp of the file Manager Nothing is async any more. Didn't work, anyway. Instead show a QProgressDialog when gathering data. Was kinda surprising that processEvents has to be called explicitly... Well, done! --- smdirwatcher.h | 54 +----------------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'smdirwatcher.h') diff --git a/smdirwatcher.h b/smdirwatcher.h index 775ca63..579a4c3 100644 --- a/smdirwatcher.h +++ b/smdirwatcher.h @@ -44,70 +44,18 @@ class SmDirWatcher : public QThread { void run(); void stop(); void setDir(const QString &dir); - void startAsyncJobs(); - void gatherAsync(const QString &path); void setExpensiveOps(bool expensiveOps); private: QList generalData(const QString &path); + int presenceData(QString &md5); int mFd; int mDescr; QString mCurrent; char *mINdata; int mBufLen; - QThreadPool *mAsyncPool; int mNumFields; - QList mAsyncTasks; bool mExpensiveOps; }; -class AsyncTask : public QObject, public QRunnable { - Q_OBJECT - public: - explicit AsyncTask(const QString &path = QString()); - bool skipMe(); - - protected: - virtual void run() = 0; - bool mSkip; - QMutex mStatusMx; - const QString mPath; -}; - -class Md5Summer : public AsyncTask { - Q_OBJECT - public: - explicit Md5Summer(const QString &path); - - signals: - void md5sumDone(QString, QString); - - protected: - virtual void run(); -}; - -class FfmpegGatherer : public AsyncTask { - Q_OBJECT - public: - explicit FfmpegGatherer(const QString &path); - - signals: - void ffmpegDone(QString, QVariantMap); - - protected: - virtual void run(); -}; - -class PicSizeGatherer : public AsyncTask { - Q_OBJECT - public: - explicit PicSizeGatherer(const QString &path); - - signals: - void picSizeDone(QString, QVariant); - - protected: - virtual void run(); -}; - #endif // SMDIRWATCHER_H -- cgit v1.2.3-70-g09d2