]> Dogcows Code - chaz/openbox/commitdiff
save workspace names properly with the new Configuration class.
authorDana Jansens <danakj@orodu.net>
Sun, 26 May 2002 20:51:12 +0000 (20:51 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 26 May 2002 20:51:12 +0000 (20:51 +0000)
src/Screen.cc
src/Workspace.cc

index 2f7e684f8e1c0a9092d478e35ac0486494f8264e..67033a82cfe4780cc8851fe9aa31abeec6bf098e 100644 (file)
@@ -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);
 }
 
 
index 3ef99ea749d054ac3e1016b17e9808af9517dd0e..0bc906cbe6e3707c91a2dfabc1e3284c1a4ec3eb 100644 (file)
@@ -382,6 +382,7 @@ void Workspace::setName(const string& new_name) {
 
   clientmenu->setLabel(name);
   clientmenu->update();
+  screen->saveWorkspaceNames();
 }
 
 
This page took 0.026509 seconds and 4 git commands to generate.