1
diff -Nur -x '*.orig' -x '*~' gnome-terminal-2.29.6/src/terminal-app.c gnome-terminal-2.29.6.new/src/terminal-app.c
2
--- gnome-terminal-2.29.6/src/terminal-app.c 2009-12-09 19:37:35.000000000 +0000
3
+++ gnome-terminal-2.29.6.new/src/terminal-app.c 2010-03-04 21:22:16.759818334 +0000
4
@@ -1175,6 +1175,117 @@
5
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_ACCEPT, name[0] != '\0');
9
+copy_to_list (gpointer data,
12
+ const char *name = (const char *) data;
13
+ GSList **profile_list = (GSList **) user_data;
15
+ *profile_list = g_slist_prepend (*profile_list, g_strdup (name));
19
+copy_value_to_list (gpointer data,
22
+ GConfValue *val = (GConfValue *) data;
23
+ GSList **list = (GSList **) user_data;
26
+ name = gconf_value_get_string (val);
27
+ *list = g_slist_prepend (*list, g_strdup (name));
31
+remove_value_from_list (gpointer data,
34
+ GConfValue *val = (GConfValue *) data;
35
+ GSList **profiles_to_add = (GSList **) user_data;
39
+ name = gconf_value_get_string (val);
41
+ node = g_slist_find_custom (*profiles_to_add, name, (GCompareFunc) g_strcmp0);
43
+ *profiles_to_add = g_slist_delete_link (*profiles_to_add, node);
49
+add_basename_to_list (gpointer data,
52
+ const char *path = (const char *) data;
53
+ GSList **list = (GSList **) user_data;
54
+ const char *basename;
56
+ basename = strrchr (path, '/');
57
+ if (++basename != NULL) {
58
+ *list = g_slist_prepend (*list, g_strdup (basename));
63
+terminal_app_catch_new_profiles (TerminalApp *app)
66
+ GSList *profile_list, *profiles_dirs;
67
+ GSList *profiles_to_add = NULL;
68
+ GSList *new_profile_list = NULL;
69
+ GError *error = NULL;
71
+ val = gconf_client_get (app->conf, PROFILE_LIST_KEY, &error);
72
+ if (error != NULL) {
73
+ g_warning ("Failed to read profile list: %s", error->message);
74
+ g_error_free (error);
78
+ if (val != NULL && (val->type != GCONF_VALUE_LIST || gconf_value_get_list_type (val) != GCONF_VALUE_STRING)) {
79
+ g_warning ("Invalid profile list");
83
+ profiles_dirs = gconf_client_all_dirs (app->conf, CONF_PROFILES_PREFIX, &error);
84
+ if (error != NULL) {
85
+ g_warning ("Failed to read profile directories: %s", error->message);
86
+ g_error_free (error);
90
+ g_slist_foreach (profiles_dirs, (GFunc) add_basename_to_list, &profiles_to_add);
93
+ profile_list = gconf_value_get_list (val);
94
+ g_slist_foreach (profile_list, (GFunc) remove_value_from_list, &profiles_to_add);
95
+ g_slist_foreach (profile_list, (GFunc) copy_value_to_list, &new_profile_list);
98
+ g_slist_foreach (profiles_to_add, (GFunc) copy_to_list, &new_profile_list);
100
+ if (!gconf_client_set_list (app->conf, PROFILE_LIST_KEY, GCONF_VALUE_STRING, new_profile_list, &error)) {
101
+ g_warning ("Failed to update profile list: %s", error->message);
102
+ g_error_free (error);
107
+ gconf_value_free (val);
109
+ g_slist_foreach (profiles_dirs, (GFunc) g_free, NULL);
110
+ g_slist_free (profiles_dirs);
112
+ g_slist_foreach (profiles_to_add, (GFunc) g_free, NULL);
113
+ g_slist_free (profiles_to_add);
115
+ g_slist_foreach (new_profile_list, (GFunc) g_free, NULL);
116
+ g_slist_free (new_profile_list);
120
terminal_app_new_profile (TerminalApp *app,
121
TerminalProfile *default_base_profile,
122
@@ -1440,6 +1551,8 @@
123
gconf_client_notify (app->conf, ENABLE_MENU_BAR_ACCEL_KEY);
124
gconf_client_notify (app->conf, ENABLE_MNEMONICS_KEY);
126
+ terminal_app_catch_new_profiles (app);
128
/* Ensure we have valid settings */
129
g_assert (app->default_profile_id != NULL);
130
g_assert (app->system_font_desc != NULL);