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
This commit is contained in:
Owen W. Taylor 2010-04-12 13:14:46 -04:00
parent debf08cac0
commit 94d47dc25e

View File

@ -2004,6 +2004,8 @@ init_commands (void)
static void static void
init_workspace_names (void) init_workspace_names (void)
{ {
int i;
#ifdef HAVE_GCONF #ifdef HAVE_GCONF
GSList *list, *l; GSList *list, *l;
const char *str_val; const char *str_val;
@ -2022,14 +2024,14 @@ init_workspace_names (void)
gconf_entry_free (entry); gconf_entry_free (entry);
} }
g_slist_free (list); g_slist_free (list);
#else #endif /* HAVE_GCONF */
int i;
for (i = 0; i < MAX_REASONABLE_WORKSPACES; i++) 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, meta_topic (META_DEBUG_PREFS,
"Initialized workspace names\n"); "Initialized workspace names\n");
#endif /* HAVE_GCONF */
} }
static gboolean static gboolean