diff options
| author | BossCode45 <human.cyborg42@gmail.com> | 2023-02-01 20:09:17 +1300 |
|---|---|---|
| committer | BossCode45 <human.cyborg42@gmail.com> | 2023-02-01 21:26:57 +1300 |
| commit | 93410601e0a9c49f3e7f9a5560054c8fd46fc154 (patch) | |
| tree | fa7f4f8ad235a90d873c85c6ca7e61594218d33e /config.cpp | |
| parent | d287854bc7aa892c9abd2eff9f7e010117c8a353 (diff) | |
| download | YATwm-93410601e0a9c49f3e7f9a5560054c8fd46fc154.tar.gz YATwm-93410601e0a9c49f3e7f9a5560054c8fd46fc154.zip | |
Actually using loadWorkspaceArrays
Diffstat (limited to 'config.cpp')
| -rw-r--r-- | config.cpp | 41 |
1 files changed, 2 insertions, 39 deletions
@@ -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); |
