From 59cea4f2d3a7ff6723b120fb52a8958ef036537e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 26 May 2002 20:51:12 +0000 Subject: [PATCH] save workspace names properly with the new Configuration class. --- src/Screen.cc | 14 ++++++++++---- src/Workspace.cc | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 2f7e684f..67033a82 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -231,6 +231,7 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(bb, scrn) { workspacesList.push_back(wkspc); workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); } + saveWorkspaceNames(); workspacemenu->insert(i18n(IconSet, IconIcons, "Icons"), iconmenu); workspacemenu->update(); @@ -472,10 +473,15 @@ void BScreen::saveClock24Hour(Bool c) { 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); } diff --git a/src/Workspace.cc b/src/Workspace.cc index 3ef99ea7..0bc906cb 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -382,6 +382,7 @@ void Workspace::setName(const string& new_name) { clientmenu->setLabel(name); clientmenu->update(); + screen->saveWorkspaceNames(); } -- 2.45.2