diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-05-02 14:01:43 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2019-05-09 04:28:41 +0000 |
commit | ecc092fa5519e77a47ef560f0137b4cd5f417c5e (patch) | |
tree | a3ef9b3cf11804311ec8fb90faa44f306bf44348 /src/imports/folderlistmodel/fileinfothread_p.h | |
parent | 0e97dedfcaa036b988d41566a37157472dfc2af6 (diff) |
Support folderlistmodel for the no-thread configv5.13.0-rc3v5.13.0-rc2v5.13.0-rc1v5.13.0-beta4v5.13.0
Scan for files on the main thread instead of using
a dedicated thread. Use a zero-timer to preserve the
async behavior where initiating a scan is fast.
This should work well for use cases like a handful
of files stored as resources.
Task-number: QTBUG-74537
Change-Id: I7bf1b6c7f9dfba69fe4fc2ea1b2dd2f256d66c2c
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/imports/folderlistmodel/fileinfothread_p.h')
-rw-r--r-- | src/imports/folderlistmodel/fileinfothread_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/imports/folderlistmodel/fileinfothread_p.h b/src/imports/folderlistmodel/fileinfothread_p.h index 438dea6faa..923cb29e03 100644 --- a/src/imports/folderlistmodel/fileinfothread_p.h +++ b/src/imports/folderlistmodel/fileinfothread_p.h @@ -99,6 +99,8 @@ public Q_SLOTS: protected: void run() override; + void runOnce(); + void initiateScan(); void getFileInfos(const QString &path); void findChangeRange(const QList<FileProperty> &list, int &fromIndex, int &toIndex); @@ -106,6 +108,7 @@ private: QMutex mutex; QWaitCondition condition; volatile bool abort; + bool scanPending; #if QT_CONFIG(filesystemwatcher) QFileSystemWatcher *watcher; |