From 94d47dc25e91ddcd9fd9d87995bd2355f93499fe Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 12 Apr 2010 13:14:46 -0400 Subject: [PATCH] Make sure all workspaces have a non-empty, non-null name The change to using gconf_client_all_entries() in commit 2d57b1b4 meant that workspaces without a GConf key for their name were not getting a name at all. Fix this by doing a post-processing loop to set workspace names that were not otherwise set. Alternate to patch from Tomas Frydrych https://bugzilla.gnome.org/show_bug.cgi?id=613136 --- src/core/prefs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/prefs.c b/src/core/prefs.c index 3435fbb6c..2b92633fd 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -2004,6 +2004,8 @@ init_commands (void) static void init_workspace_names (void) { + int i; + #ifdef HAVE_GCONF GSList *list, *l; const char *str_val; @@ -2022,14 +2024,14 @@ init_workspace_names (void) gconf_entry_free (entry); } g_slist_free (list); -#else - int i; +#endif /* HAVE_GCONF */ + for (i = 0; i < MAX_REASONABLE_WORKSPACES; i++) - workspace_names[i] = g_strdup_printf (_("Workspace %d"), i + 1); + if (workspace_names[i] == NULL) + workspace_names[i] = g_strdup_printf (_("Workspace %d"), i + 1); meta_topic (META_DEBUG_PREFS, "Initialized workspace names\n"); -#endif /* HAVE_GCONF */ } static gboolean