diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-05-12 01:15:32 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-05-12 01:15:32 +0100 |
| commit | 413a36a914d5ccab38feb3cab93db8f2b1352363 (patch) | |
| tree | 81c2410d36470bd447b8a81a7e42c0e6c3e51f32 /src/config/ConfigManager.cpp | |
| parent | 86ef85efaec16a20816d64d4c6aff34c01c0c9b7 (diff) | |
workspacerules: overwrite on existing
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 833e17e4..3b558540 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1125,7 +1125,12 @@ void CConfigManager::handleWorkspaceRules(const std::string& command, const std: wsRule.workspaceId = id; wsRule.workspaceName = name; - m_dWorkspaceRules.emplace_back(wsRule); + const auto IT = std::find_if(m_dWorkspaceRules.begin(), m_dWorkspaceRules.end(), [&](const auto& other) { return other.workspaceString == wsRule.workspaceString; }); + + if (IT == m_dWorkspaceRules.end()) + m_dWorkspaceRules.emplace_back(wsRule); + else + *IT = wsRule; } void CConfigManager::handleSubmap(const std::string& command, const std::string& submap) { |
