gnome-terminal r3148 - branches/gnome-2-24/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r3148 - branches/gnome-2-24/src
- Date: Thu, 9 Oct 2008 13:36:13 +0000 (UTC)
Author: chpe
Date: Thu Oct 9 13:36:13 2008
New Revision: 3148
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=3148&view=rev
Log:
Make sure we always get a system font and default profile name, falling
back to the default when getting the gconf key fails.
Modified:
branches/gnome-2-24/src/terminal-app.c
Modified: branches/gnome-2-24/src/terminal-app.c
==============================================================================
--- branches/gnome-2-24/src/terminal-app.c (original)
+++ branches/gnome-2-24/src/terminal-app.c Thu Oct 9 13:36:13 2008
@@ -815,19 +815,19 @@
{
TerminalApp *app = TERMINAL_APP (user_data);
GConfValue *gconf_value;
- const char *font;
+ const char *font = NULL;
PangoFontDescription *font_desc;
if (strcmp (gconf_entry_get_key (entry), MONOSPACE_FONT_KEY) != 0)
return;
gconf_value = gconf_entry_get_value (entry);
- if (!gconf_value || gconf_value->type != GCONF_VALUE_STRING)
- return;
-
- font = gconf_value_get_string (gconf_value);
+ if (gconf_value &&
+ gconf_value->type == GCONF_VALUE_STRING)
+ font = gconf_value_get_string (gconf_value);
if (!font)
- return;
+ font = DEFAULT_MONOSPACE_FONT;
+ g_assert (font != NULL);
font_desc = pango_font_description_from_string (font);
if (app->system_font_desc &&
@@ -1365,6 +1365,10 @@
global_app = app;
+ /* Initialise defaults */
+ app->enable_mnemonics = DEFAULT_ENABLE_MNEMONICS;
+ app->enable_menu_accels = DEFAULT_ENABLE_MENU_BAR_ACCEL;
+
app->profiles = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
app->conf = gconf_client_get_default ();
@@ -1405,12 +1409,17 @@
terminal_app_enable_menu_accels_notify_cb,
app, NULL, NULL);
+ /* Load the settings */
gconf_client_notify (app->conf, PROFILE_LIST_KEY);
gconf_client_notify (app->conf, DEFAULT_PROFILE_KEY);
gconf_client_notify (app->conf, MONOSPACE_FONT_KEY);
gconf_client_notify (app->conf, ENABLE_MENU_BAR_ACCEL_KEY);
gconf_client_notify (app->conf, ENABLE_MNEMONICS_KEY);
+ /* Ensure we have valid settings */
+ g_assert (app->default_profile_id != NULL);
+ g_assert (app->system_font_desc != NULL);
+
terminal_accels_init ();
terminal_encoding_init ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]