workspacerule: Fix monitor settings being deleted when merging ws rules (#5864)

* fix deleting monitor settings when merging rules

* use empty and workspace invalid
This commit is contained in:
thejch 2024-05-03 18:18:04 -07:00 committed by GitHub
parent a3b4923c42
commit 40201a760a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -993,6 +993,15 @@ SWorkspaceRule CConfigManager::getWorkspaceRuleFor(PHLWORKSPACE pWorkspace) {
SWorkspaceRule CConfigManager::mergeWorkspaceRules(const SWorkspaceRule& rule1, const SWorkspaceRule& rule2) {
SWorkspaceRule mergedRule = rule1;
if (rule1.monitor.empty())
mergedRule.monitor = rule2.monitor;
if (rule1.workspaceString.empty())
mergedRule.workspaceString = rule2.workspaceString;
if (rule1.workspaceName.empty())
mergedRule.workspaceName = rule2.workspaceName;
if (rule1.workspaceId == WORKSPACE_INVALID)
mergedRule.workspaceId = rule2.workspaceId;
if (rule2.isDefault)
mergedRule.isDefault = true;
if (rule2.isPersistent)