CMake: Apply build directory change on editingFinished

Otherwise every time a character is typed, a dialog pops up, and that
dialog is closed without triggering a cmake run, the value is reset.

Add that behavior optionally to StringAspect.

Change-Id: I6831d1622f08acae6df43d4ceb2bf7367c96a747
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2021-06-22 13:54:16 +02:00
parent e13c2b7403
commit 1d600101ee
3 changed files with 39 additions and 5 deletions

View File

@@ -182,6 +182,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
container->setWidget(details);
auto buildDirAspect = bc->buildDirectoryAspect();
buildDirAspect->setAutoApplyOnEditingFinished(true);
connect(buildDirAspect, &BaseAspect::changed, this, [this]() {
m_configModel->flush(); // clear out config cache...;
});
@@ -851,7 +852,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
return newDir;
if (QDir(oldDir).exists("CMakeCache.txt") && !QDir(newDir).exists("CMakeCache.txt")) {
if (QMessageBox::information(nullptr,
if (QMessageBox::information(Core::ICore::dialogParent(),
tr("Changing Build Directory"),
tr("Change the build directory and start with a "
"basic CMake configuration?"),