all repos — openbox @ 59cea4f2d3a7ff6723b120fb52a8958ef036537e

openbox fork - make it a bit more like ryudo

save workspace names properly with the new Configuration class.
Dana Jansens danakj@orodu.net
commit

59cea4f2d3a7ff6723b120fb52a8958ef036537e

parent

0305cbdc3ae8525c74b2bb9b23884035549e3407

2 files changed, 11 insertions(+), 4 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -231,6 +231,7 @@ wkspc = new Workspace(this, workspacesList.size());

workspacesList.push_back(wkspc); workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); } + saveWorkspaceNames(); workspacemenu->insert(i18n(IconSet, IconIcons, "Icons"), iconmenu); workspacemenu->update();

@@ -472,10 +473,15 @@ #endif // HAVE_STRFTIME

void BScreen::saveWorkspaceNames() { - string save_string = getWorkspace(0)->getName(); - for (unsigned int i = 1; i < getWorkspaceCount(); ++i) - save_string += ',' + getWorkspace(i)->getName(); - config->setValue(screenstr + "workspaceNames", save_string); + string names; + WorkspaceList::iterator it; + WorkspaceList::iterator last = workspacesList.end() - 1; + for (it = workspacesList.begin(); it != workspacesList.end(); ++it) { + names += (*it)->getName(); + if (it != last) + names += ','; + } + config->setValue(screenstr + "workspaceNames", names); }
M src/Workspace.ccsrc/Workspace.cc

@@ -382,6 +382,7 @@ }

clientmenu->setLabel(name); clientmenu->update(); + screen->saveWorkspaceNames(); }