Skip to content

Commit

Permalink
vkconfig: Fix user-path duplication on reset
Browse files Browse the repository at this point in the history
Change-Id: I069bda176a11ef32a9df4a6581d84b98d32cf60f
  • Loading branch information
christophe-lunarg committed Jul 16, 2024
1 parent 7e4873b commit 93e5a06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vkconfig_core/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ bool Configuration::Load2_2(const std::vector<Layer>& available_layers, const QJ
this->platform_flags = GetPlatformFlags(ReadStringArray(json_configuration_object, "platforms"));
}

this->user_defined_paths.clear();
if (json_configuration_object.value("layers_paths") != QJsonValue::Undefined) {
std::vector<std::string> paths = ReadStringArray(json_configuration_object, "layers_paths");
for (std::size_t i = 0, n = paths.size(); i < n; ++i) {
Expand Down Expand Up @@ -212,8 +213,8 @@ bool Configuration::Save(const std::vector<Layer>& available_layers, const std::
json_configuration.insert("layers", json_layers);

QJsonArray json_paths;
for (std::size_t i = 0, n = user_defined_paths.size(); i < n; ++i) {
json_paths.append(user_defined_paths[i].c_str());
for (std::size_t i = 0, n = this->user_defined_paths.size(); i < n; ++i) {
json_paths.append(this->user_defined_paths[i].c_str());
}
json_configuration.insert("layers_paths", json_paths);

Expand Down

0 comments on commit 93e5a06

Please sign in to comment.