diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-02-28 04:17:02 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-02-28 04:17:02 +0800 |
commit | 180e9032df85343ae81de583b99b90511b1cf507 (patch) | |
tree | 624afffd5b74cc44510f0191e311ac2ae6499daf /mail/em-folder-view.c | |
parent | 77ce8408267d25bd060e5558847f61bc70575e82 (diff) | |
download | gsoc2013-evolution-180e9032df85343ae81de583b99b90511b1cf507.tar.gz gsoc2013-evolution-180e9032df85343ae81de583b99b90511b1cf507.tar.zst gsoc2013-evolution-180e9032df85343ae81de583b99b90511b1cf507.zip |
If gconf_entry_get_value() returns NULL, then it means the key was unset
2004-02-27 Jeffrey Stedfast <fejj@ximian.com>
* em-folder-view.c (emfv_setting_notify): If
gconf_entry_get_value() returns NULL, then it means the key was
unset or something. Don't use g_return_if_fail() for that.
First of the lockdown fixes...
* em-composer-prefs.c (em_composer_prefs_construct): Same as
below.
* em-mailer-prefs.c (em_mailer_prefs_construct): Respect
locked-down keys by disabling their sensitivity to the user.
(settings_changed): Don't re-enable check_incoming_imap if the key
is locked.
svn path=/trunk/; revision=24911
Diffstat (limited to 'mail/em-folder-view.c')
-rw-r--r-- | mail/em-folder-view.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index a6d45dec63..d7da84caff 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -2014,27 +2014,30 @@ static GHashTable *emfv_setting_key; static void emfv_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, EMFolderView *emfv) { + GConfValue *value; char *tkey; g_return_if_fail (gconf_entry_get_key (entry) != NULL); - g_return_if_fail (gconf_entry_get_value (entry) != NULL); + + if (!(value = gconf_entry_get_value (entry))) + return; tkey = strrchr(entry->key, '/'); g_return_if_fail (tkey != NULL); switch(GPOINTER_TO_INT(g_hash_table_lookup(emfv_setting_key, tkey+1))) { case EMFV_ANIMATE_IMAGES: - em_format_html_display_set_animate(emfv->preview, gconf_value_get_bool(gconf_entry_get_value(entry))); + em_format_html_display_set_animate(emfv->preview, gconf_value_get_bool (value)); break; case EMFV_CHARSET: - em_format_set_default_charset((EMFormat *)emfv->preview, gconf_value_get_string(gconf_entry_get_value(entry))); + em_format_set_default_charset((EMFormat *)emfv->preview, gconf_value_get_string (value)); break; case EMFV_CITATION_COLOUR: { const char *s; GdkColor colour; guint32 rgb; - s = gconf_value_get_string(gconf_entry_get_value(entry)); + s = gconf_value_get_string (value); gdk_color_parse(s?s:"#737373", &colour); rgb = ((colour.red & 0xff00) << 8) | (colour.green & 0xff00) | ((colour.blue & 0xff00) >> 8); em_format_html_set_mark_citations((EMFormatHTML *)emfv->preview, @@ -2042,15 +2045,15 @@ emfv_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, EMFold break; } case EMFV_CITATION_MARK: em_format_html_set_mark_citations((EMFormatHTML *)emfv->preview, - gconf_value_get_bool(gconf_entry_get_value(entry)), + gconf_value_get_bool (value), ((EMFormatHTML *)emfv->preview)->citation_colour); break; case EMFV_CARET_MODE: - em_format_html_display_set_caret_mode(emfv->preview, gconf_value_get_bool(gconf_entry_get_value(entry))); + em_format_html_display_set_caret_mode(emfv->preview, gconf_value_get_bool (value)); break; case EMFV_MESSAGE_STYLE: if (EM_FOLDER_VIEW_GET_CLASS (emfv)->update_message_style) { - int style = gconf_value_get_int(gconf_entry_get_value(entry)); + int style = gconf_value_get_int (value); if (style < EM_FORMAT_NORMAL || style > EM_FORMAT_SOURCE) style = EM_FORMAT_NORMAL; @@ -2058,19 +2061,19 @@ emfv_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, EMFold } break; case EMFV_MARK_SEEN: - emfv->mark_seen = gconf_value_get_bool(gconf_entry_get_value(entry)); + emfv->mark_seen = gconf_value_get_bool (value); break; case EMFV_MARK_SEEN_TIMEOUT: - emfv->mark_seen_timeout = gconf_value_get_int(gconf_entry_get_value(entry)); + emfv->mark_seen_timeout = gconf_value_get_int (value); break; case EMFV_LOAD_HTTP: { - int style = gconf_value_get_int(gconf_entry_get_value(entry)); + int style = gconf_value_get_int (value); /* FIXME: this doesn't handle the 'sometimes' case, only the always case */ em_format_html_set_load_http((EMFormatHTML *)emfv->preview, style == 2); break; } case EMFV_XMAILER_MASK: - em_format_html_set_xmailer_mask((EMFormatHTML *)emfv->preview, gconf_value_get_int(gconf_entry_get_value(entry))); + em_format_html_set_xmailer_mask((EMFormatHTML *)emfv->preview, gconf_value_get_int (value)); break; case EMFV_HEADERS: { GSList *header_config_list, *p; |