aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-31 07:05:30 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-08-31 08:35:11 +0800
commitf67a5f3d42aa9d743e6b78ace26a6ed1dbdc43e7 (patch)
tree98d3c6e13879d356ed0a4236ed9d2f5d48627980 /modules
parent60383e0427e57bfb5e2fb836b450ec7cf9717b5f (diff)
downloadgsoc2013-evolution-f67a5f3d42aa9d743e6b78ace26a6ed1dbdc43e7.tar
gsoc2013-evolution-f67a5f3d42aa9d743e6b78ace26a6ed1dbdc43e7.tar.gz
gsoc2013-evolution-f67a5f3d42aa9d743e6b78ace26a6ed1dbdc43e7.tar.bz2
gsoc2013-evolution-f67a5f3d42aa9d743e6b78ace26a6ed1dbdc43e7.tar.lz
gsoc2013-evolution-f67a5f3d42aa9d743e6b78ace26a6ed1dbdc43e7.tar.xz
gsoc2013-evolution-f67a5f3d42aa9d743e6b78ace26a6ed1dbdc43e7.tar.zst
gsoc2013-evolution-f67a5f3d42aa9d743e6b78ace26a6ed1dbdc43e7.zip
Miscellaneous cleanups.
Reducing diff noise with the account-mgmt branch. Trying to erode our dependency on EAccount as much as possible, or at least isolate its usage, to make things easier for me on the branch.
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-backend.h3
-rw-r--r--modules/mail/e-mail-shell-settings.c3
-rw-r--r--modules/mail/e-mail-shell-view-actions.c39
-rw-r--r--modules/mail/e-mail-shell-view.c13
-rw-r--r--modules/mail/em-composer-prefs.c9
5 files changed, 34 insertions, 33 deletions
diff --git a/modules/mail/e-mail-shell-backend.h b/modules/mail/e-mail-shell-backend.h
index e545fa2566..edec7c67a3 100644
--- a/modules/mail/e-mail-shell-backend.h
+++ b/modules/mail/e-mail-shell-backend.h
@@ -24,9 +24,6 @@
#include <mail/e-mail-backend.h>
-#include <e-util/e-signature-list.h>
-#include <libedataserver/e-account-list.h>
-
/* Standard GObject macros */
#define E_TYPE_MAIL_SHELL_BACKEND \
(e_mail_shell_backend_get_type ())
diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c
index d795749c82..99402d5f29 100644
--- a/modules/mail/e-mail-shell-settings.c
+++ b/modules/mail/e-mail-shell-settings.c
@@ -26,9 +26,6 @@
#include "e-mail-shell-settings.h"
#include <gconf/gconf-client.h>
-#include <libedataserver/e-account-list.h>
-
-#include <e-util/e-signature-list.h>
#include <mail/e-mail-backend.h>
#include <mail/e-mail-label-list-store.h>
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index 5db80011aa..f4f5ea26f6 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -87,8 +87,11 @@ action_mail_account_disable_cb (GtkAction *action,
EMailBackend *backend;
EMailSession *session;
EMFolderTree *folder_tree;
+ CamelService *service;
+ CamelStore *store;
EAccountList *account_list;
EAccount *account;
+ const gchar *uid;
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
@@ -99,7 +102,12 @@ action_mail_account_disable_cb (GtkAction *action,
session = e_mail_backend_get_session (backend);
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
- account = em_folder_tree_get_selected_account (folder_tree);
+ store = em_folder_tree_get_selected_store (folder_tree);
+ g_return_if_fail (store != NULL);
+
+ service = CAMEL_SERVICE (store);
+ uid = camel_service_get_uid (service);
+ account = e_get_account_by_uid (uid);
g_return_if_fail (account != NULL);
account_list = e_get_account_list ();
@@ -308,7 +316,6 @@ action_mail_folder_expunge_cb (GtkAction *action,
EShellBackend *shell_backend;
EShellWindow *shell_window;
EShellView *shell_view;
- EMailSession *session;
CamelFolder *folder;
/* This handles both the "folder-expunge" and "account-expunge"
@@ -329,9 +336,10 @@ action_mail_folder_expunge_cb (GtkAction *action,
g_return_if_fail (folder != NULL);
shell_backend = e_shell_view_get_shell_backend (shell_view);
- session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend));
- em_utils_expunge_folder (GTK_WIDGET (shell_window), session, folder);
+ em_utils_expunge_folder (
+ GTK_WIDGET (shell_window),
+ E_MAIL_BACKEND (shell_backend), folder);
}
static void
@@ -594,17 +602,14 @@ action_mail_global_expunge_cb (GtkAction *action,
EShellBackend *shell_backend;
EShellWindow *shell_window;
EShellView *shell_view;
- EMailBackend *backend;
- EMailSession *session;
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
shell_backend = e_shell_view_get_shell_backend (shell_view);
- backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
-
- em_utils_empty_trash (GTK_WIDGET (shell_window), session);
+ em_utils_empty_trash (
+ GTK_WIDGET (shell_window),
+ E_MAIL_BACKEND (shell_backend));
}
static void
@@ -1056,9 +1061,8 @@ action_mail_tools_subscriptions_cb (GtkAction *action,
EMailBackend *backend;
EMailSession *session;
EMFolderTree *folder_tree;
- EAccount *account;
GtkWidget *dialog;
- CamelStore *store = NULL;
+ CamelStore *store;
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
@@ -1066,20 +1070,11 @@ action_mail_tools_subscriptions_cb (GtkAction *action,
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
- account = em_folder_tree_get_selected_account (folder_tree);
+ store = em_folder_tree_get_selected_store (folder_tree);
backend = E_MAIL_BACKEND (shell_backend);
session = e_mail_backend_get_session (backend);
- if (account != NULL) {
- CamelService *service;
-
- service = camel_session_get_service (
- CAMEL_SESSION (session), account->uid);
- if (service != NULL)
- store = CAMEL_STORE (service);
- }
-
dialog = em_subscription_editor_new (
GTK_WINDOW (shell_window),
CAMEL_SESSION (session), store);
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index 73041d7971..5759b5830f 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -828,6 +828,7 @@ mail_shell_view_update_actions (EShellView *shell_view)
EMFolderTreeModel *model;
EMailReader *reader;
EMailView *mail_view;
+ CamelStore *store;
EAccount *account;
GtkAction *action;
GList *list, *link;
@@ -883,7 +884,17 @@ mail_shell_view_update_actions (EShellView *shell_view)
(state & E_MAIL_SIDEBAR_STORE_IS_SUBSCRIBABLE);
uri = em_folder_tree_get_selected_uri (folder_tree);
- account = em_folder_tree_get_selected_account (folder_tree);
+ store = em_folder_tree_get_selected_store (folder_tree);
+
+ if (store != NULL) {
+ CamelService *service;
+ const gchar *uid;
+
+ service = CAMEL_SERVICE (store);
+ uid = camel_service_get_uid (service);
+ account = e_get_account_by_uid (uid);
+ } else
+ account = NULL;
if (uri != NULL) {
GtkTreeRowReference *reference;
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c
index f8825f701c..d5b1c6697d 100644
--- a/modules/mail/em-composer-prefs.c
+++ b/modules/mail/em-composer-prefs.c
@@ -569,10 +569,11 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
G_BINDING_SYNC_CREATE);
/* Sanitize the dialog for Express mode */
- e_shell_hide_widgets_for_express_mode (shell, prefs->builder,
- "chkOutlookFilenames",
- "chkTopSignature",
- NULL);
+ e_shell_hide_widgets_for_express_mode (
+ shell, prefs->builder,
+ "chkOutlookFilenames",
+ "chkTopSignature",
+ NULL);
/* get our toplevel widget */
client = gconf_client_get_default ();