aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2022-02-09 16:25:41 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2022-02-10 08:06:09 +0000
commit105e5910601f6e5bafa6e92fe795075f7b24de71 (patch)
treee86b377be11e1cccf64644c6e01d827ba5594530
parenta1cc9b4e5c65415242211a7ea62a5bb17fef5676 (diff)
ProjectExplorer: Delay project parsing until it's part of the session
E.g. code model logic relies on the session manager knowing about the project currently being parsed. Fixes: QTCREATORBUG-26987 Change-Id: I4d9a1c21ab8474f7ac21edaeebe667fc4f3a6c4e Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r--src/plugins/projectexplorer/buildsystem.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/buildsystem.cpp b/src/plugins/projectexplorer/buildsystem.cpp
index 8382d2d060..424b49d802 100644
--- a/src/plugins/projectexplorer/buildsystem.cpp
+++ b/src/plugins/projectexplorer/buildsystem.cpp
@@ -29,6 +29,7 @@
#include "projectexplorer.h"
#include "runconfiguration.h"
#include "runcontrol.h"
+#include "session.h"
#include "target.h"
#include <coreplugin/messagemanager.h>
@@ -77,7 +78,13 @@ BuildSystem::BuildSystem(Target *target)
// Timer:
d->m_delayedParsingTimer.setSingleShot(true);
- connect(&d->m_delayedParsingTimer, &QTimer::timeout, this, &BuildSystem::triggerParsing);
+ connect(&d->m_delayedParsingTimer, &QTimer::timeout, this,
+ [this] {
+ if (SessionManager::hasProject(project()))
+ triggerParsing();
+ else
+ requestDelayedParse();
+ });
}
BuildSystem::~BuildSystem()