From 5671c5270b78e146a0e4c30837522dc61e5a8150 Mon Sep 17 00:00:00 2001 From: dou fu Date: Thu, 1 Sep 2022 03:28:11 -0400 Subject: cmake-gui: Fix selected item mismatched CMAKE_GENERATOR_PLATFORM env The first empty item in the combobox causes a misalignment with the actual setting by `CMAKE_GENERATOR_PLATFORM` environment variable. --- Source/QtDialog/FirstConfigure.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx index f3c4a8b..707eaae 100644 --- a/Source/QtDialog/FirstConfigure.cxx +++ b/Source/QtDialog/FirstConfigure.cxx @@ -244,7 +244,8 @@ void StartCompilerSetup::onGeneratorChanged(int index) if (!DefaultGeneratorPlatform.isEmpty()) { int platform_index = platforms.indexOf(DefaultGeneratorPlatform); if (platform_index != -1) { - this->PlatformOptions->setCurrentIndex(platform_index); + // The index is off-by-one due to the first empty item added above. + this->PlatformOptions->setCurrentIndex(platform_index + 1); } } } else { -- cgit v0.12