From c69d2e291de70a8b63aad7938f4c89b4ba993ffc Mon Sep 17 00:00:00 2001 From: Christophe Date: Tue, 1 Oct 2024 12:55:59 +0200 Subject: [PATCH] vkconfig2: SDK 296 bugfixing - Fix renaming configuration with the same name but different cases - Fix launch button saying Tarminate instead of launch --- vkconfig/CHANGELOG.md | 1 + vkconfig/mainwindow.cpp | 1 - vkconfig_core/util.h | 12 ++++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/vkconfig/CHANGELOG.md b/vkconfig/CHANGELOG.md index d74d6b5cdd..dafd5b5365 100644 --- a/vkconfig/CHANGELOG.md +++ b/vkconfig/CHANGELOG.md @@ -20,6 +20,7 @@ - Fix flag settings dependencies - Fix filesystem settings update - Fix overridden implicit layer ordering +- Fix renaming configuration with the same name but different cases ## [Vulkan Configurator 2.6.1](https://github.com/LunarG/VulkanTools/tree/vulkan-sdk-1.3.290.0) - July 2024 diff --git a/vkconfig/mainwindow.cpp b/vkconfig/mainwindow.cpp index a0239a1d66..89d4167a65 100644 --- a/vkconfig/mainwindow.cpp +++ b/vkconfig/mainwindow.cpp @@ -416,7 +416,6 @@ void MainWindow::UpdateUI() { // Launcher states const bool has_application_list = !environment.GetApplications().empty(); ui->push_button_launcher->setEnabled(has_application_list); - ui->push_button_launcher->setText(_launch_application ? "Terminate" : "Launch"); ui->check_box_clear_on_launch->setChecked(environment.Get(LAYOUT_LAUNCHER_NOT_CLEAR) != "true"); ui->launcher_loader_debug->blockSignals(true); // avoid calling again UpdateUI ui->launcher_loader_debug->setCurrentIndex(GetLoaderMessageType(environment.GetLoaderMessageTypes())); diff --git a/vkconfig_core/util.h b/vkconfig_core/util.h index e5e4feb773..bf30a792b5 100644 --- a/vkconfig_core/util.h +++ b/vkconfig_core/util.h @@ -65,8 +65,12 @@ T* FindByKey(std::vector& container, const char* key) { assert(key != nullptr); assert(std::strcmp(key, "") != 0); + const std::string low_key = ToLowerCase(std::string(key)); + for (std::size_t i = 0, n = container.size(); i < n; ++i) { - if (container[i].key == key) return &container[i]; + if (ToLowerCase(container[i].key) == low_key) { + return &container[i]; + } } return nullptr; @@ -77,8 +81,12 @@ const T* FindByKey(const std::vector& container, const char* key) { assert(key != nullptr); assert(std::strcmp(key, "") != 0); + const std::string low_key = ToLowerCase(std::string(key)); + for (std::size_t i = 0, n = container.size(); i < n; ++i) { - if (container[i].key == key) return &container[i]; + if (ToLowerCase(container[i].key) == low_key) { + return &container[i]; + } } return nullptr;