From f071a3301b844a4b5af71b5bc4fbf0e5ae8e62bf Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 26 Feb 2021 12:34:11 +0200 Subject: [PATCH] QmlDesigner: Hold import progress while application inactive Creator's global filesystem watcher doesn't trigger while the application is inactive, so changes to file system are not detected it that is the case. Hold the import process while we are waiting for filesystem update if the application is inactive. Fixes: QDS-3809 Change-Id: If55a5ce45ddf06095d7ea51c5dec4f882e83d81f Reviewed-by: Mahmoud Badri Reviewed-by: Thomas Hartmann --- .../components/itemlibrary/itemlibraryassetimporter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp index b78dcb6eece..f434788dda7 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp @@ -664,7 +664,12 @@ void ItemLibraryAssetImporter::finalizeQuick3DImport() timer->callOnTimeout([this, timer, progressTitle, model, doc]() { if (!isCancelled()) { notifyProgress(++counter * 5, progressTitle); - if (counter == 10) { + if (counter < 10) { + // Do not proceed while application isn't active as the filesystem + // watcher qmljs uses won't trigger unless application is active + if (QApplication::applicationState() != Qt::ApplicationActive) + --counter; + } else if (counter == 10) { model->rewriterView()->textModifier()->replace(0, 0, {}); } else if (counter == 19) { try {