Libravatar: use accessor for common preferences
authorRicardo Mones <ricardo@mones.org>
Tue, 9 Jun 2015 07:43:35 +0000 (09:43 +0200)
committerRicardo Mones <ricardo@mones.org>
Tue, 9 Jun 2015 07:43:35 +0000 (09:43 +0200)
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

src/plugins/libravatar/libravatar.c
src/plugins/libravatar/libravatar_prefs.c

index 3088fa262ad7352b390fa8364c6401013e0ef05a..a09e6d0e79319896f336e4cbca69ac54226c9f99 100644 (file)
@@ -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;
                }
index 4c015451af2535a62190d22fbd692a61ae243cd4..f3c3be427aa7293a0bd9d70b9cb4a9fa4d907fdb 100644 (file)
@@ -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;