Skip to content

Commit

Permalink
vkconfig2: SDK 296 bugfixing
Browse files Browse the repository at this point in the history
- Fix renaming configuration with the same name but different cases
- Fix launch button saying Tarminate instead of launch
  • Loading branch information
christophe-lunarg committed Oct 1, 2024
1 parent b2b3234 commit 3622f36
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 30 deletions.
1 change: 1 addition & 0 deletions vkconfig/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion vkconfig/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
66 changes: 37 additions & 29 deletions vkconfig_core/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,35 +60,6 @@ bool IsNumber(const std::string& s);

bool IsFloat(const std::string& s);

template <typename T>
T* FindByKey(std::vector<T>& container, const char* key) {
assert(key != nullptr);
assert(std::strcmp(key, "") != 0);

for (std::size_t i = 0, n = container.size(); i < n; ++i) {
if (container[i].key == key) return &container[i];
}

return nullptr;
}

template <typename T>
const T* FindByKey(const std::vector<T>& container, const char* key) {
assert(key != nullptr);
assert(std::strcmp(key, "") != 0);

for (std::size_t i = 0, n = container.size(); i < n; ++i) {
if (container[i].key == key) return &container[i];
}

return nullptr;
}

template <typename T>
bool IsFound(const std::vector<T>& container, const char* key) {
return FindByKey(container, key) != nullptr;
}

// Remove a value if it's present
void RemoveString(std::vector<std::string>& list, const std::string& value);

Expand Down Expand Up @@ -167,3 +138,40 @@ bool IsValueFound(const std::vector<EnabledNumberOrString>& list, const NumberOr
QStringList ConvertValues(const std::vector<NumberOrString>& values);

std::string GetLayerSettingPrefix(const std::string& key);

template <typename T>
T* FindByKey(std::vector<T>& 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 (ToLowerCase(container[i].key) == low_key) {
return &container[i];
}
}

return nullptr;
}

template <typename T>
const T* FindByKey(const std::vector<T>& 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 (ToLowerCase(container[i].key) == low_key) {
return &container[i];
}
}

return nullptr;
}

template <typename T>
bool IsFound(const std::vector<T>& container, const char* key) {
return FindByKey(container, key) != nullptr;
}

0 comments on commit 3622f36

Please sign in to comment.