Skip to content

Commit 59ce9dc

Browse files
committed
CMakePM: Fix saving "Initial Configuration" values
Amends 6c57178 The CMakeBuildSystem::clearCMakeCache() would call BuildSystem::emitParsingFinished which would clear the configuration in the widget, effectively removing any "Initial Configuration" changes when clicking on the "Re-configure with Initial Parameters" button. This commit makes sure that the updateInitialCMakeArguments() function is called before CMakeBuildSystem::clearCMakeCache(), and that only the "Build > Clear CMake Configuration" action would "disableCMakeBuildMenuActions" which is what an user would expect. Fixes: QTCREATORBUG-31320 Change-Id: Ie7810c9bed000ca19a31a6ab8e7a281ae9f5e6f0 Reviewed-by: Alessandro Portale <[email protected]>
1 parent 01acba9 commit 59ce9dc

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,10 @@ void CMakeBuildSettingsWidget::reconfigureWithInitialParameters()
621621
if (reply != QMessageBox::Yes)
622622
return;
623623

624-
m_buildConfig->cmakeBuildSystem()->clearCMakeCache();
625-
626624
updateInitialCMakeArguments();
627625

626+
m_buildConfig->cmakeBuildSystem()->clearCMakeCache();
627+
628628
if (ProjectExplorerPlugin::saveModifiedFiles())
629629
m_buildConfig->cmakeBuildSystem()->runCMake();
630630
}

src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,11 @@ void CMakeBuildSystem::clearCMakeCache()
12391239
path.removeRecursively();
12401240

12411241
emit configurationCleared();
1242+
}
1243+
1244+
void CMakeBuildSystem::disableCMakeBuildMenuActions()
1245+
{
1246+
emitParsingStarted();
12421247
emitParsingFinished(false);
12431248
}
12441249

src/plugins/cmakeprojectmanager/cmakebuildsystem.h

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class CMakeBuildSystem final : public ProjectExplorer::BuildSystem
7777

7878
bool persistCMakeState();
7979
void clearCMakeCache();
80+
void disableCMakeBuildMenuActions();
8081

8182
// Context menu actions:
8283
void buildCMakeTarget(const QString &buildTarget);

src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ void CMakeManager::clearCMakeCache(BuildSystem *buildSystem)
262262
QTC_ASSERT(cmakeBuildSystem, return);
263263

264264
cmakeBuildSystem->clearCMakeCache();
265+
cmakeBuildSystem->disableCMakeBuildMenuActions();
265266
}
266267

267268
void CMakeManager::runCMake(BuildSystem *buildSystem)

0 commit comments

Comments
 (0)