From: Ricardo Mones Date: Tue, 9 Jun 2015 07:43:35 +0000 (+0200) Subject: Libravatar: use accessor for common preferences X-Git-Tag: 3.12.0~122 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=43f6bcc91fb86aa0acfa1620dda37049c9c026f4 Libravatar: use accessor for common preferences Fixes crash on Windows when loading preferences page. Original patch thanks to Ticho: http://git.claws-mail.org/?p=claws-win32-installer.git;a=commitdiff;h=956cf9f8 --- diff --git a/src/plugins/libravatar/libravatar.c b/src/plugins/libravatar/libravatar.c index 3088fa262..a09e6d0e7 100644 --- a/src/plugins/libravatar/libravatar.c +++ b/src/plugins/libravatar/libravatar.c @@ -286,7 +286,7 @@ static gboolean libravatar_image_render_hook(gpointer source, gpointer data) return FALSE; } /* not cached copy: try network */ - if (prefs_common.work_offline) { + if (prefs_common_get_prefs()->work_offline) { debug_print("working off-line: libravatar network retrieval skipped\n"); return FALSE; } diff --git a/src/plugins/libravatar/libravatar_prefs.c b/src/plugins/libravatar/libravatar_prefs.c index 4c015451a..f3c3be427 100644 --- a/src/plugins/libravatar/libravatar_prefs.c +++ b/src/plugins/libravatar/libravatar_prefs.c @@ -179,10 +179,10 @@ static void default_mode_radio_button_cb(GtkToggleButton *button, gpointer data) TRUE); if (mode == DEF_MODE_NONE) { - prefs_common.enable_avatars = AVATARS_ENABLE_BOTH; + prefs_common_get_prefs()->enable_avatars = AVATARS_ENABLE_BOTH; } else { /* don't waste time with headers that won't be displayed */ - prefs_common.enable_avatars = AVATARS_DISABLE; + prefs_common_get_prefs()->enable_avatars = AVATARS_DISABLE; /* empty missing cache when switching to generated */ g_hash_table_remove_all(libravatarmisses); } @@ -263,8 +263,9 @@ static GtkWidget *p_create_frame_missing(struct LibravatarPrefsPage *page) libravatarprefs.default_mode = DEF_MODE_NONE; } /* don't waste time with headers that won't be displayed */ - prefs_common.enable_avatars = (libravatarprefs.default_mode == DEF_MODE_NONE) - ? AVATARS_ENABLE_BOTH: AVATARS_DISABLE; + prefs_common_get_prefs()->enable_avatars = + (libravatarprefs.default_mode == DEF_MODE_NONE) + ? AVATARS_ENABLE_BOTH: AVATARS_DISABLE;