From 8726a7363eb9213235e6e23657668e0daac39a5b Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:52:37 -0400 Subject: config: cleanup the entire config infrastructure (#13785) Massively refactors the config infrastructure, sorely needed and will be req'd for the lua stuff --- src/config/shared/workspace/WorkspaceRule.cpp | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/config/shared/workspace/WorkspaceRule.cpp (limited to 'src/config/shared/workspace/WorkspaceRule.cpp') diff --git a/src/config/shared/workspace/WorkspaceRule.cpp b/src/config/shared/workspace/WorkspaceRule.cpp new file mode 100644 index 00000000..28d5fcab --- /dev/null +++ b/src/config/shared/workspace/WorkspaceRule.cpp @@ -0,0 +1,48 @@ +#include "WorkspaceRule.hpp" + +using namespace Config; + +void CWorkspaceRule::mergeLeft(const CWorkspaceRule& other) { + if (m_monitor.empty()) + m_monitor = other.m_monitor; + if (m_workspaceString.empty()) + m_workspaceString = other.m_workspaceString; + if (m_workspaceName.empty()) + m_workspaceName = other.m_workspaceName; + if (m_workspaceId == WORKSPACE_INVALID) + m_workspaceId = other.m_workspaceId; + + if (other.m_isDefault) + m_isDefault = true; + if (other.m_isPersistent) + m_isPersistent = true; + if (other.m_gapsIn.has_value()) + m_gapsIn = other.m_gapsIn; + if (other.m_gapsOut.has_value()) + m_gapsOut = other.m_gapsOut; + if (other.m_floatGaps) + m_floatGaps = other.m_floatGaps; + if (other.m_borderSize.has_value()) + m_borderSize = other.m_borderSize; + if (other.m_noBorder.has_value()) + m_noBorder = other.m_noBorder; + if (other.m_noRounding.has_value()) + m_noRounding = other.m_noRounding; + if (other.m_decorate.has_value()) + m_decorate = other.m_decorate; + if (other.m_noShadow.has_value()) + m_noShadow = other.m_noShadow; + if (other.m_onCreatedEmptyRunCmd.has_value()) + m_onCreatedEmptyRunCmd = other.m_onCreatedEmptyRunCmd; + if (other.m_defaultName.has_value()) + m_defaultName = other.m_defaultName; + if (other.m_layout.has_value()) + m_layout = other.m_layout; + if (!other.m_layoutopts.empty()) { + for (const auto& layoutopt : other.m_layoutopts) { + m_layoutopts[layoutopt.first] = layoutopt.second; + } + } + if (other.m_animationStyle.has_value()) + m_animationStyle = other.m_animationStyle; +} -- cgit v1.2.3