aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-05-22 17:50:02 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-05-23 08:45:26 +0000
commit4e3f44504e09c4a38298e3eeed84083c577363b2 (patch)
tree6fa0ae78be3d5172dff295b6e01daf6abf6249ed
parente83b69a500f8ddd21d63f5fe731439022d3ed110 (diff)
Fix module provider bug in IDE mode
When re-resolving a project with an existing in-memory build graph, we must make sure that the old project object does not remove the generated modules from the build directory in its destructor. This fixes the following bug in Qt Creator: - Open a project initially (but do not build). - Edit the project file and re-resolve. - Build the project. This now fails, because the generated modules were erroneously removed in step 2. Change-Id: If6c1c1ed986e8f00e4d89ba5525bac7e032388d9 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/lib/corelib/api/internaljobs.cpp5
-rw-r--r--src/lib/corelib/language/language.cpp11
-rw-r--r--src/lib/corelib/language/language.h2
3 files changed, 15 insertions, 3 deletions
diff --git a/src/lib/corelib/api/internaljobs.cpp b/src/lib/corelib/api/internaljobs.cpp
index 4d06821fd..f07927c71 100644
--- a/src/lib/corelib/api/internaljobs.cpp
+++ b/src/lib/corelib/api/internaljobs.cpp
@@ -268,8 +268,11 @@ void InternalSetupProjectJob::start()
deleteLocker = true;
}
execute();
- if (m_existingProject)
+ if (m_existingProject) {
+ if (m_existingProject != m_newProject)
+ m_existingProject->makeModuleProvidersNonTransient();
m_existingProject->bgLocker = nullptr;
+ }
m_newProject->bgLocker = bgLocker;
deleteLocker = false;
} catch (const ErrorInfo &error) {
diff --git a/src/lib/corelib/language/language.cpp b/src/lib/corelib/language/language.cpp
index 239eddf1f..f21f724f1 100644
--- a/src/lib/corelib/language/language.cpp
+++ b/src/lib/corelib/language/language.cpp
@@ -622,6 +622,12 @@ QString TopLevelProject::profile() const
return projectProperties().value(StringConstants::profileProperty()).toString();
}
+void TopLevelProject::makeModuleProvidersNonTransient()
+{
+ for (ModuleProviderInfo &m : moduleProviderInfo)
+ m.transientOutput = false;
+}
+
QString TopLevelProject::buildGraphFilePath() const
{
return ProjectBuildData::deriveBuildGraphFilePath(buildDirectory, id());
@@ -637,8 +643,9 @@ void TopLevelProject::store(Logger logger)
qCDebug(lcBuildGraph) << "build graph is unchanged in project" << id();
return;
}
- for (ModuleProviderInfo &m : moduleProviderInfo)
- m.transientOutput = false;
+
+ makeModuleProvidersNonTransient();
+
const QString fileName = buildGraphFilePath();
qCDebug(lcBuildGraph) << "storing:" << fileName;
PersistentPool pool(logger);
diff --git a/src/lib/corelib/language/language.h b/src/lib/corelib/language/language.h
index 82d9f94a2..297fedf1c 100644
--- a/src/lib/corelib/language/language.h
+++ b/src/lib/corelib/language/language.h
@@ -711,6 +711,8 @@ public:
const QVariantMap &buildConfiguration() const { return m_buildConfiguration; }
QString id() const { return m_id; }
QString profile() const;
+ void makeModuleProvidersNonTransient();
+
QVariantMap profileConfigs;
QVariantMap overriddenValues;