talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 33fd5d6227e037fa5ff50ed5e1a07db8630e7f8e
parent 13198cd1802012dec7e8c87a6185b4f8c11f63ae
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Tue,  7 Jul 2015 18:44:34 +0200

Use accessor for common preferences in all plugins.

Diffstat:
Msrc/plugins/att_remover/att_remover.c | 2+-
Msrc/plugins/att_remover/claws.def | 1-
Msrc/plugins/bogofilter/bogofilter.c | 2+-
Msrc/plugins/bsfilter/bsfilter.c | 2+-
Msrc/plugins/bsfilter/claws.def | 1-
Msrc/plugins/clamd/clamav_plugin.c | 4++--
Msrc/plugins/gdata/cm_gdata_contacts.c | 2+-
Msrc/plugins/geolocation/geolocation_plugin.c | 2+-
Msrc/plugins/python/clawsmailmodule.c | 4++--
Msrc/plugins/rssyl/claws.def | 1-
Msrc/plugins/rssyl/rssyl_cb_menu.c | 2+-
Msrc/plugins/rssyl/rssyl_feed.c | 2+-
Msrc/plugins/rssyl/rssyl_update_feed.c | 6+++---
Msrc/plugins/spamassassin/spamassassin.c | 8++++----
14 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/src/plugins/att_remover/att_remover.c b/src/plugins/att_remover/att_remover.c @@ -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); diff --git a/src/plugins/att_remover/claws.def b/src/plugins/att_remover/claws.def @@ -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 diff --git a/src/plugins/bogofilter/bogofilter.c b/src/plugins/bogofilter/bogofilter.c @@ -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); } diff --git a/src/plugins/bsfilter/bsfilter.c b/src/plugins/bsfilter/bsfilter.c @@ -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); } diff --git a/src/plugins/bsfilter/claws.def b/src/plugins/bsfilter/claws.def @@ -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 diff --git a/src/plugins/clamd/clamav_plugin.c b/src/plugins/clamd/clamav_plugin.c @@ -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 { diff --git a/src/plugins/gdata/cm_gdata_contacts.c b/src/plugins/gdata/cm_gdata_contacts.c @@ -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"); } diff --git a/src/plugins/geolocation/geolocation_plugin.c b/src/plugins/geolocation/geolocation_plugin.c @@ -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; } diff --git a/src/plugins/python/clawsmailmodule.c b/src/plugins/python/clawsmailmodule.c @@ -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; diff --git a/src/plugins/rssyl/claws.def b/src/plugins/rssyl/claws.def @@ -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 diff --git a/src/plugins/rssyl/rssyl_cb_menu.c b/src/plugins/rssyl/rssyl_cb_menu.c @@ -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.", diff --git a/src/plugins/rssyl/rssyl_feed.c b/src/plugins/rssyl/rssyl_feed.c @@ -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 ) { diff --git a/src/plugins/rssyl/rssyl_update_feed.c b/src/plugins/rssyl/rssyl_update_feed.c @@ -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; diff --git a/src/plugins/spamassassin/spamassassin.c b/src/plugins/spamassassin/spamassassin.c @@ -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 */