From 93410601e0a9c49f3e7f9a5560054c8fd46fc154 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Wed, 1 Feb 2023 20:09:17 +1300 Subject: Actually using loadWorkspaceArrays --- config.cpp | 41 ++--------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) (limited to 'config.cpp') 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("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(); - if(element) - { - workspaceNames[i] = *element; - } - else - { - cerr << "Element " << i << " in `workspaceNames` is not a string" << endl; - workspaceNames[i] = ""; - } - } maxMonitors = getValue("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(); - 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("Keybinds.swapSuperAlt", &err); -- cgit v1.2.3