From 3f86c62a81c9c252b2b2fcfe6b193ae3ea63e8d3 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Wed, 19 Oct 2022 10:47:45 +0200 Subject: [PATCH] Gather file infos synchronously on no-thread builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/itemmodels/qfileinfogatherer.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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()