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 a60c1efa9e5e10c49dd88e0209438f01b717845c..a629515745a337639e2b89254a5bb4b2438192ca 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 2c69e2c89981e75f2cec7659837e64e931311fb8..6b2cf4e09ed83a03a6a9e7b308d9887259f03453 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 66bd311e3cdf3640f1890fc235d105f27f082155..45ef823f7a87e90e7a26e930220657fe67f532c1 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 8484b2c7c825bedda49a7837ae37644b11aed120..ac051e507c608541ea1ea45d1ae4a5930a5f7334 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 2c39c40e1b387193b830799c2c7c49cdf4c069b0..602907b9e7b14dc4dce33e33e3171a84dc688fdc 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 c363e959bde9bee08bad6e0920df791a77800ce3..42f60bfaee5a019b2b85ea1e73b523276d9fb760 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 b6f39ff3a4c35c0095a0a77849a23a6f7dbafa86..20ae00d5381761370d409a2ec63ace9b165c4f4c 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 ed5fc87d97b779152756890e4b59e57d7350c4b0..158d82524c9132735258813297cd1d9182a9e8de 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 c573aafd438ebde06c2e6d14b9a419e73952ae3a..5ce3b95732ac3939c958c2fafbc3e6592d4501d1 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 d819beda798bf4ee19dfbad9cdefc656e01a65d9..ad106c9416d500f5b8125c371e92dee822abf2c6 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 771791b1032b0ee1cd8372a327b606147a2b468b..2d31a883d3b3448deb8deb476d117fa938a3f90c 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 46edc014d176518046e3ce51bf14aa30d7d5b1f8..302ddc00e0c81ea59c825a445beef12169e4a105 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 284b5485ae24d39b3c1ac3282131ec69db3037f7..8e8b964cc35792cab50d1a49790076e88b35e56c 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 41753d949a2307009304d0c3a899558fd9fec4f7..98dd1adefce78841c0e7e4a87b70e0277bbf6ca4 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 */