summaryrefslogtreecommitdiff
path: root/config.cpp
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2023-02-01 20:09:17 +1300
committerBossCode45 <human.cyborg42@gmail.com>2023-02-01 21:26:57 +1300
commit93410601e0a9c49f3e7f9a5560054c8fd46fc154 (patch)
treefa7f4f8ad235a90d873c85c6ca7e61594218d33e /config.cpp
parentd287854bc7aa892c9abd2eff9f7e010117c8a353 (diff)
downloadYATwm-93410601e0a9c49f3e7f9a5560054c8fd46fc154.tar.gz
YATwm-93410601e0a9c49f3e7f9a5560054c8fd46fc154.zip
Actually using loadWorkspaceArrays
Diffstat (limited to 'config.cpp')
-rw-r--r--config.cpp41
1 files changed, 2 insertions, 39 deletions
diff --git a/config.cpp b/config.cpp
index d1ec74f..74ba0b0 100644
--- a/config.cpp
+++ b/config.cpp
@@ -223,46 +223,9 @@ Err Config::loadFromFile(string path)
//Workspaces
numWS = getValue<int>("Workspaces.numWS", &err);
- workspaceNamesc = tbl["Workspaces"]["workspaceNames"].as_array()->size();
- workspaceNames = new string[workspaceNamesc];
- for(int i = 0; i < workspaceNamesc; i++)
- {
- auto element = tbl["Workspaces"]["workspaceNames"][i].value<string>();
- if(element)
- {
- workspaceNames[i] = *element;
- }
- else
- {
- cerr << "Element " << i << " in `workspaceNames` is not a string" << endl;
- workspaceNames[i] = "";
- }
- }
maxMonitors = getValue<int>("Workspaces.maxMonitors", &err);
- screenPreferencesc = tbl["Workspaces"]["screenPreferences"].as_array()->size();
- screenPreferences = new int*[screenPreferencesc];
- for(int i = 0; i < screenPreferencesc; i++)
- {
- int* wsScreens = new int[maxMonitors];
- for(int j = 0; j < maxMonitors; j++)
- {
- if(tbl["Workspaces"]["screenPreferences"][i].as_array()->size() <= j)
- {
- wsScreens[j] = 0;
- continue;
- }
- auto element = tbl["Workspaces"]["screenPreferences"][i][j].value<int>();
- if(element)
- wsScreens[j] = *element;
- else
- {
- cerr << "Element " << i << " " << j << " int `screenPreferences` is not an int" << endl;
- wsScreens[j] = 0;
- }
- }
- screenPreferences[i] = wsScreens;
- }
-
+ loadWorkspaceArrays(tbl, defaults, &err);
+
//Keybinds
bool swapSuperAlt = getValue<bool>("Keybinds.swapSuperAlt", &err);