forked from qt-creator/qt-creator
CMakePM: Fix saving "Initial Configuration" values
Amends 6c5717844d
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 <alessandro.portale@qt.io>
This commit is contained in:
@@ -621,10 +621,10 @@ void CMakeBuildSettingsWidget::reconfigureWithInitialParameters()
|
|||||||
if (reply != QMessageBox::Yes)
|
if (reply != QMessageBox::Yes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_buildConfig->cmakeBuildSystem()->clearCMakeCache();
|
|
||||||
|
|
||||||
updateInitialCMakeArguments();
|
updateInitialCMakeArguments();
|
||||||
|
|
||||||
|
m_buildConfig->cmakeBuildSystem()->clearCMakeCache();
|
||||||
|
|
||||||
if (ProjectExplorerPlugin::saveModifiedFiles())
|
if (ProjectExplorerPlugin::saveModifiedFiles())
|
||||||
m_buildConfig->cmakeBuildSystem()->runCMake();
|
m_buildConfig->cmakeBuildSystem()->runCMake();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1239,6 +1239,11 @@ void CMakeBuildSystem::clearCMakeCache()
|
|||||||
path.removeRecursively();
|
path.removeRecursively();
|
||||||
|
|
||||||
emit configurationCleared();
|
emit configurationCleared();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMakeBuildSystem::disableCMakeBuildMenuActions()
|
||||||
|
{
|
||||||
|
emitParsingStarted();
|
||||||
emitParsingFinished(false);
|
emitParsingFinished(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ public:
|
|||||||
|
|
||||||
bool persistCMakeState();
|
bool persistCMakeState();
|
||||||
void clearCMakeCache();
|
void clearCMakeCache();
|
||||||
|
void disableCMakeBuildMenuActions();
|
||||||
|
|
||||||
// Context menu actions:
|
// Context menu actions:
|
||||||
void buildCMakeTarget(const QString &buildTarget);
|
void buildCMakeTarget(const QString &buildTarget);
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ void CMakeManager::clearCMakeCache(BuildSystem *buildSystem)
|
|||||||
QTC_ASSERT(cmakeBuildSystem, return);
|
QTC_ASSERT(cmakeBuildSystem, return);
|
||||||
|
|
||||||
cmakeBuildSystem->clearCMakeCache();
|
cmakeBuildSystem->clearCMakeCache();
|
||||||
|
cmakeBuildSystem->disableCMakeBuildMenuActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeManager::runCMake(BuildSystem *buildSystem)
|
void CMakeManager::runCMake(BuildSystem *buildSystem)
|
||||||
|
|||||||
Reference in New Issue
Block a user