diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-10-19 10:47:45 +0200 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-10-21 09:14:10 +0200 |
commit | 3f86c62a81c9c252b2b2fcfe6b193ae3ea63e8d3 (patch) | |
tree | d0f2e545101f926120e2130cd93361173149b874 /src/gui/itemmodels | |
parent | 738e05a55a4047268553eea6b9f4809d42181eef (diff) |
Gather file infos synchronously on no-thread builds
QFileInfoGatherer is implicitly dependent on threads - there are
no compile guards but the file scan loop runs on a thread.
Make it gather file infos sync if threads are not enabled so that
signals are properly fired from it on filesystem scans.
Fixes: QTBUG-85445
Backport-to: 6.4 5.15
Change-Id: I55f37497aa97bde2fc0fa2dece33c95acc870e99
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/gui/itemmodels')
-rw-r--r-- | src/gui/itemmodels/qfileinfogatherer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/itemmodels/qfileinfogatherer.cpp b/src/gui/itemmodels/qfileinfogatherer.cpp index 662c7188aa..f7c36b4ca8 100644 --- a/src/gui/itemmodels/qfileinfogatherer.cpp +++ b/src/gui/itemmodels/qfileinfogatherer.cpp @@ -121,9 +121,13 @@ void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStr } loc = this->path.lastIndexOf(path, loc - 1); } +#if QT_CONFIG(thread) this->path.push(path); this->files.push(files); condition.wakeAll(); +#else // !QT_CONFIG(thread) + getFileInfos(path, files); +#endif // QT_CONFIG(thread) #if QT_CONFIG(filesystemwatcher) if (files.isEmpty() |