Use accessor for common preferences in all plugins.
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 7 Jul 2015 16:44:34 +0000 (18:44 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 7 Jul 2015 16:44:34 +0000 (18:44 +0200)
14 files changed:
src/plugins/att_remover/att_remover.c
src/plugins/att_remover/claws.def
src/plugins/bogofilter/bogofilter.c
src/plugins/bsfilter/bsfilter.c
src/plugins/bsfilter/claws.def
src/plugins/clamd/clamav_plugin.c
src/plugins/gdata/cm_gdata_contacts.c
src/plugins/geolocation/geolocation_plugin.c
src/plugins/python/clawsmailmodule.c
src/plugins/rssyl/claws.def
src/plugins/rssyl/rssyl_cb_menu.c
src/plugins/rssyl/rssyl_feed.c
src/plugins/rssyl/rssyl_update_feed.c
src/plugins/spamassassin/spamassassin.c

index a60c1ef..a629515 100644 (file)
@@ -349,7 +349,7 @@ static void remove_attachments_dialog(AttRemover *attremover)
                                  -1));
        list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model));
        g_object_unref(model);  
-       gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere);
+       gtk_tree_view_set_rules_hint(list_view, prefs_common_get_prefs()->use_stripes_everywhere);
        
        renderer = gtk_cell_renderer_toggle_new();
        g_signal_connect(renderer, "toggled", G_CALLBACK(remove_toggled_cb), model);
index 2c69e2c..6b2cf4e 100644 (file)
@@ -35,7 +35,6 @@ matcherlist_new
 matcherprop_new
 pref_get_escaped_pref
 pref_get_unescaped_pref
-prefs_common
 prefs_common_get_prefs
 prefs_file_close
 prefs_file_close_revert
index 66bd311..45ef823 100644 (file)
@@ -619,7 +619,7 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                        msg =  g_strdup_printf(_("The Bogofilter plugin couldn't filter "
                                           "a message. The command `%s %s %s` couldn't be run."), 
                                           bogo_args[0], bogo_args[1], bogo_args[2]);
-               if (!prefs_common.no_recv_err_panel) {
+               if (!prefs_common_get_prefs()->no_recv_err_panel) {
                        if (!warned_error) {
                                alertpanel_error("%s", msg);
                        }
index 8484b2c..ac051e5 100644 (file)
@@ -400,7 +400,7 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                        msg =  g_strdup_printf(_("The Bsfilter plugin couldn't filter "
                                           "a message. The command `%s` couldn't be run."), 
                                           bs_exec);
-               if (!prefs_common.no_recv_err_panel) {
+               if (!prefs_common_get_prefs()->no_recv_err_panel) {
                        if (!warned_error) {
                                alertpanel_error("%s", msg);
                        }
index 2c39c40..602907b 100644 (file)
@@ -17,7 +17,6 @@ matcherlist_new
 matcherprop_new
 pref_get_escaped_pref
 pref_get_unescaped_pref
-prefs_common
 prefs_file_close
 prefs_file_close_revert
 prefs_gtk_register_page
index c363e95..42f60bf 100644 (file)
@@ -119,8 +119,8 @@ static gboolean scan_func(GNode *node, gpointer data)
                                                msg = g_strconcat(_("Detected %s virus."),
                                                        clamd_get_virus_name(buf.msg), NULL);
                                                g_warning("%s\n", msg);
-                                               debug_print("no_recv: %d\n", prefs_common.no_recv_err_panel);
-                                               if (prefs_common.no_recv_err_panel) {
+                                               debug_print("no_recv: %d\n", prefs_common_get_prefs()->no_recv_err_panel);
+                                               if (prefs_common_get_prefs()->no_recv_err_panel) {
                                                    statusbar_print_all("%s", msg);
                                                }
                                                else {
index b6f39ff..20ae00d 100644 (file)
@@ -603,7 +603,7 @@ void cm_gdata_add_contacts(GList **address_list)
 
 gboolean cm_gdata_update_contacts_cache(void)
 {
-  if(prefs_common.work_offline)
+  if(prefs_common_get_prefs()->work_offline)
   {
     debug_print("GData plugin: Offline mode\n");
   }
index ed5fc87..158d825 100644 (file)
@@ -488,7 +488,7 @@ static gboolean my_messageview_show_hook(gpointer source, gpointer data)
   }
 
   /* do nothing except hiding the button if claws mail is in offline mode */
-  if(prefs_common.work_offline) {
+  if(prefs_common_get_prefs()->work_offline) {
     gtk_widget_hide(container);
     return FALSE;
   }
index c573aaf..5ce3b95 100644 (file)
@@ -353,7 +353,7 @@ static PyObject* quicksearch_search(PyObject *self, PyObject *args)
   MainWindow *mainwin;
 
   /* must be given exactly one argument, which is a string */
-  searchtype = prefs_common.summary_quicksearch_type;
+  searchtype = prefs_common_get_prefs()->summary_quicksearch_type;
   if(!PyArg_ParseTuple(args, "s|i", &string, &searchtype))
     return NULL;
 
@@ -382,7 +382,7 @@ static PyObject* quicksearch_clear(PyObject *self, PyObject *args)
   }
 
   qs = mainwin->summaryview->quicksearch;
-  quicksearch_set(qs, prefs_common.summary_quicksearch_type, "");
+  quicksearch_set(qs, prefs_common_get_prefs()->summary_quicksearch_type, "");
 
   Py_INCREF(Py_None);
   return Py_None;
index d819bed..ad106c9 100644 (file)
@@ -89,7 +89,6 @@ make_dir_hier
 mh_get_class
 move_file
 msgcache_destroy
-prefs_common
 prefs_common_get_prefs
 prefs_file_close
 prefs_file_close_revert
index 771791b..2d31a88 100644 (file)
@@ -250,7 +250,7 @@ void rssyl_refresh_feed_cb(GtkAction *action,
        ritem = (RFolderItem *)item;
 
        /* Offline check */
-       if( prefs_common.work_offline &&
+       if( prefs_common_get_prefs()->work_offline &&
                        !inc_offline_should_override(TRUE,
                                        ngettext("Claws Mail needs network access in order "
                                        "to update the feed.",
index 46edc01..302ddc0 100644 (file)
@@ -128,7 +128,7 @@ gboolean rssyl_refresh_timeout_cb(gpointer data)
 
        g_return_val_if_fail(ctx != NULL, FALSE);
 
-       if( prefs_common.work_offline)
+       if( prefs_common_get_prefs()->work_offline)
                return TRUE;
 
        if( ctx->ritem == NULL || ctx->ritem->url == NULL ) {
index 284b548..8e8b964 100644 (file)
@@ -165,7 +165,7 @@ RFetchCtx *rssyl_prep_fetchctx_from_item(RFolderItem *ritem)
        ctx->success = TRUE;
        ctx->ready = FALSE;
 
-       feed_set_timeout(ctx->feed, prefs_common.io_timeout_secs);
+       feed_set_timeout(ctx->feed, prefs_common_get_prefs()->io_timeout_secs);
        feed_set_cookies_path(ctx->feed, rssyl_prefs_get()->cookies_path);
        feed_set_ssl_verify_peer(ctx->feed, ritem->ssl_verify_peer);
        feed_set_auth(ctx->feed, ritem->auth);
@@ -191,7 +191,7 @@ RFetchCtx *rssyl_prep_fetchctx_from_url(gchar *url)
        ctx->success = TRUE;
        ctx->ready = FALSE;
 
-       feed_set_timeout(ctx->feed, prefs_common.io_timeout_secs);
+       feed_set_timeout(ctx->feed, prefs_common_get_prefs()->io_timeout_secs);
        feed_set_cookies_path(ctx->feed, rssyl_prefs_get()->cookies_path);
        feed_set_ssl_verify_peer(ctx->feed, rssyl_prefs_get()->ssl_verify_peer);
 #ifdef G_OS_WIN32
@@ -325,7 +325,7 @@ void rssyl_update_all_func(FolderItem *item, gpointer data)
 
 void rssyl_update_all_feeds(void)
 {
-       if (prefs_common.work_offline &&
+       if (prefs_common_get_prefs()->work_offline &&
                        !inc_offline_should_override(TRUE,
                                _("Claws Mail needs network access in order to update your feeds.")) ) {
                return;
index 41753d9..98dd1ad 100644 (file)
@@ -373,7 +373,7 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                                           "a message. The probable cause of the error "
                                           "is an unreachable spamd daemon. Please make "
                                           "sure spamd is running and accessible.");
-               if (!prefs_common.no_recv_err_panel) {
+               if (!prefs_common_get_prefs()->no_recv_err_panel) {
                        if (!warned_error) {
                                alertpanel_error("%s", msg);
                        }
@@ -424,7 +424,7 @@ int spamassassin_learn(MsgInfo *msginfo, GSList *msglist, gboolean spam)
        }
 
        if (config.transport == SPAMASSASSIN_TRANSPORT_TCP
-       &&  prefs_common.work_offline
+       &&  prefs_common_get_prefs()->work_offline
        &&  !inc_offline_should_override(TRUE,
                _("Claws Mail needs network access in order "
                  "to feed this mail(s) to the remote learner."))) {
@@ -445,7 +445,7 @@ int spamassassin_learn(MsgInfo *msginfo, GSList *msglist, gboolean spam)
                } else {
                        cmd = g_strdup_printf("sa-learn -u %s%s %s %s",
                                                        config.username,
-                                                       prefs_common.work_offline?" -L":"",
+                                                       prefs_common_get_prefs()->work_offline?" -L":"",
                                                        spam?"--spam":"--ham", file);
                }
        }
@@ -479,7 +479,7 @@ int spamassassin_learn(MsgInfo *msginfo, GSList *msglist, gboolean spam)
                } else {
                        cmd = g_strdup_printf("sa-learn -u %s%s %s",
                                        config.username,
-                                       prefs_common.work_offline?" -L":"",
+                                       prefs_common_get_prefs()->work_offline?" -L":"",
                                        spam?"--spam":"--ham");
 
                        /* concatenate all message tmpfiles to the sa-learn command-line */