commit 43f6bcc91fb86aa0acfa1620dda37049c9c026f4
parent 298a94adf85b4df86c277fa08d764a39b1706224
Author: Ricardo Mones <ricardo@mones.org>
Date: Tue, 9 Jun 2015 09:43:35 +0200
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
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git 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
@@ -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;