aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-09-27 13:13:42 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-09-27 21:31:13 +0800
commite2b6ff7a6c1e1580c26ee0719b349151e8dad6fd (patch)
treed2d2ce8eb509717d412ad3171059e470ff0e7030 /modules
parentc520043a094d81d222aa0c3e23b0035ddb89d0bf (diff)
downloadgsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.gz
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.zst
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.zip
Miscellaneous cleanups from the account-mgmt branch.
Reducing diff noise so I can see important changes easier when comparing branches. A few API changes, but nothing that affects functionality.
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-backend.c12
-rw-r--r--modules/mail/e-mail-shell-view-actions.c18
-rw-r--r--modules/mail/e-mail-shell-view-private.c16
-rw-r--r--modules/mail/em-account-prefs.c22
-rw-r--r--modules/mail/em-composer-prefs.c33
-rw-r--r--modules/mail/em-composer-prefs.h4
6 files changed, 46 insertions, 59 deletions
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 5eb5ce9f53..4cf3cb78a5 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -234,8 +234,6 @@ mail_shell_backend_mail_sync (EMailShellBackend *mail_shell_backend)
{
EShell *shell;
EShellBackend *shell_backend;
- EMailBackend *backend;
- EMailSession *session;
shell_backend = E_SHELL_BACKEND (mail_shell_backend);
shell = e_shell_backend_get_shell (shell_backend);
@@ -248,11 +246,9 @@ mail_shell_backend_mail_sync (EMailShellBackend *mail_shell_backend)
if (mail_shell_backend->priv->mail_sync_in_progress)
goto exit;
- backend = E_MAIL_BACKEND (mail_shell_backend);
- session = e_mail_backend_get_session (backend);
-
e_mail_store_foreach (
- session, (GFunc) mail_shell_backend_sync_store_cb,
+ E_MAIL_BACKEND (mail_shell_backend),
+ (GFunc) mail_shell_backend_sync_store_cb,
mail_shell_backend);
exit:
@@ -445,7 +441,6 @@ mail_shell_backend_start (EShellBackend *shell_backend)
EShell *shell;
EShellSettings *shell_settings;
EMailBackend *backend;
- EMailSession *session;
gboolean enable_search_folders;
const gchar *data_dir;
@@ -455,10 +450,9 @@ mail_shell_backend_start (EShellBackend *shell_backend)
shell_settings = e_shell_get_shell_settings (shell);
backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
data_dir = e_shell_backend_get_data_dir (shell_backend);
- e_mail_store_init (session, data_dir);
+ e_mail_store_init (backend, data_dir);
enable_search_folders = e_shell_settings_get_boolean (
shell_settings, "mail-enable-search-folders");
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index f4f5ea26f6..6d9b3a4252 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -85,7 +85,6 @@ action_mail_account_disable_cb (GtkAction *action,
EShellBackend *shell_backend;
EShellView *shell_view;
EMailBackend *backend;
- EMailSession *session;
EMFolderTree *folder_tree;
CamelService *service;
CamelStore *store;
@@ -99,7 +98,6 @@ action_mail_account_disable_cb (GtkAction *action,
shell_backend = e_shell_view_get_shell_backend (shell_view);
backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
store = em_folder_tree_get_selected_store (folder_tree);
@@ -117,7 +115,7 @@ action_mail_account_disable_cb (GtkAction *action,
account->enabled = !account->enabled;
e_account_list_change (account_list, account);
- e_mail_store_remove_by_account (session, account);
+ e_mail_store_remove_by_account (backend, account);
if (account->parent_uid != NULL)
e_account_list_remove (account_list, account);
@@ -227,17 +225,15 @@ action_mail_download_cb (GtkAction *action,
EMailView *mail_view;
EMailReader *reader;
EMailBackend *backend;
- EMailSession *session;
mail_shell_content = mail_shell_view->priv->mail_shell_content;
mail_view = e_mail_shell_content_get_mail_view (mail_shell_content);
reader = E_MAIL_READER (mail_view);
backend = e_mail_reader_get_backend (reader);
- session = e_mail_backend_get_session (backend);
e_mail_store_foreach (
- session, (GFunc) action_mail_download_foreach_cb, reader);
+ backend, (GFunc) action_mail_download_foreach_cb, reader);
}
static void
@@ -247,15 +243,12 @@ action_mail_flush_outbox_cb (GtkAction *action,
EShellBackend *shell_backend;
EShellView *shell_view;
EMailBackend *backend;
- EMailSession *session;
shell_view = E_SHELL_VIEW (mail_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);
- mail_send (session);
+ mail_send (backend);
}
static void
@@ -1059,7 +1052,6 @@ action_mail_tools_subscriptions_cb (GtkAction *action,
EShellWindow *shell_window;
EShellView *shell_view;
EMailBackend *backend;
- EMailSession *session;
EMFolderTree *folder_tree;
GtkWidget *dialog;
CamelStore *store;
@@ -1073,11 +1065,9 @@ action_mail_tools_subscriptions_cb (GtkAction *action,
store = em_folder_tree_get_selected_store (folder_tree);
backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
dialog = em_subscription_editor_new (
- GTK_WINDOW (shell_window),
- CAMEL_SESSION (session), store);
+ GTK_WINDOW (shell_window), backend, store);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index a7309904bd..30a6756ddf 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -1089,7 +1089,6 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view,
EMailSendReceiveMode mode,
const gchar *account_uid)
{
- EMailSession *session;
EShellView *shell_view;
EShellWindow *shell_window;
EShellBackend *shell_backend;
@@ -1100,20 +1099,22 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view,
shell_window = e_shell_view_get_shell_window (shell_view);
shell_backend = e_shell_view_get_shell_backend (shell_view);
- session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend));
-
em_utils_clear_get_password_canceled_accounts_flag ();
if (!account_uid) {
switch (mode) {
case E_MAIL_SEND_RECEIVE_BOTH:
- mail_send_receive (GTK_WINDOW (shell_window), session);
+ mail_send_receive (
+ GTK_WINDOW (shell_window),
+ E_MAIL_BACKEND (shell_backend));
break;
case E_MAIL_SEND_RECEIVE_RECEIVE:
- mail_receive (GTK_WINDOW (shell_window), session);
+ mail_receive (
+ GTK_WINDOW (shell_window),
+ E_MAIL_BACKEND (shell_backend));
break;
case E_MAIL_SEND_RECEIVE_SEND:
- mail_send (session);
+ mail_send (E_MAIL_BACKEND (shell_backend));
break;
}
} else {
@@ -1124,7 +1125,8 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view,
g_return_if_fail (account != NULL);
if (account->enabled && account->source != NULL)
- mail_receive_account (session, account);
+ mail_receive_account (
+ E_MAIL_BACKEND (shell_backend), account);
}
}
diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c
index 1b11b41b68..0dc93bea1f 100644
--- a/modules/mail/em-account-prefs.c
+++ b/modules/mail/em-account-prefs.c
@@ -62,7 +62,9 @@ G_DEFINE_TYPE (
E_TYPE_ACCOUNT_MANAGER)
static gboolean
-account_prefs_toggle_enable_special (EMAccountPrefs *prefs, EAccountTreeViewSelectedType type, gboolean enabled)
+account_prefs_toggle_enable_special (EMAccountPrefs *prefs,
+ EAccountTreeViewSelectedType type,
+ gboolean enabled)
{
const gchar *prop = NULL;
EShell *shell;
@@ -96,7 +98,6 @@ account_prefs_enable_account_cb (EAccountTreeView *tree_view,
EMAccountPrefs *prefs)
{
EAccount *account;
- EMailSession *session;
account = e_account_tree_view_get_selected (tree_view);
if (!account) {
@@ -106,8 +107,7 @@ account_prefs_enable_account_cb (EAccountTreeView *tree_view,
g_return_if_fail (account != NULL);
- session = e_mail_backend_get_session (prefs->priv->backend);
- e_mail_store_add_by_account (session, account);
+ e_mail_store_add_by_account (prefs->priv->backend, account);
}
static void
@@ -115,7 +115,6 @@ account_prefs_disable_account_cb (EAccountTreeView *tree_view,
EMAccountPrefs *prefs)
{
EAccountList *account_list;
- EMailSession *session;
EAccount *account;
gpointer parent;
gint response;
@@ -131,10 +130,8 @@ account_prefs_disable_account_cb (EAccountTreeView *tree_view,
account_list = e_account_tree_view_get_account_list (tree_view);
g_return_if_fail (account_list != NULL);
- session = e_mail_backend_get_session (prefs->priv->backend);
-
if (!e_account_list_account_has_proxies (account_list, account)) {
- e_mail_store_remove_by_account (session, account);
+ e_mail_store_remove_by_account (prefs->priv->backend, account);
return;
}
@@ -151,7 +148,7 @@ account_prefs_disable_account_cb (EAccountTreeView *tree_view,
e_account_list_remove_account_proxies (account_list, account);
- e_mail_store_remove_by_account (session, account);
+ e_mail_store_remove_by_account (prefs->priv->backend, account);
}
static void
@@ -323,14 +320,12 @@ account_prefs_delete_account (EAccountManager *manager)
EMAccountPrefsPrivate *priv;
EAccountTreeView *tree_view;
EAccountList *account_list;
- EMailSession *session;
EAccount *account;
gboolean has_proxies;
gpointer parent;
gint response;
priv = EM_ACCOUNT_PREFS (manager)->priv;
- session = e_mail_backend_get_session (priv->backend);
account_list = e_account_manager_get_account_list (manager);
tree_view = e_account_manager_get_tree_view (manager);
@@ -359,7 +354,7 @@ account_prefs_delete_account (EAccountManager *manager)
/* Remove the account from the folder tree. */
if (account->enabled)
- e_mail_store_remove_by_account (session, account);
+ e_mail_store_remove_by_account (priv->backend, account);
/* Remove all the proxies the account has created. */
if (has_proxies)
@@ -423,7 +418,8 @@ em_account_prefs_init (EMAccountPrefs *prefs)
}
static void
-account_tree_view_sort_order_changed_cb (EAccountTreeView *tree_view, EMailBackend *backend)
+account_tree_view_sort_order_changed_cb (EAccountTreeView *tree_view,
+ EMailBackend *backend)
{
GSList *account_uids;
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c
index fb49352357..12a521b454 100644
--- a/modules/mail/em-composer-prefs.c
+++ b/modules/mail/em-composer-prefs.c
@@ -43,16 +43,16 @@
#include <gtkhtml/gtkhtml.h>
#include <editor/gtkhtml-spell-language.h>
-#include "e-util/e-util.h"
-#include "e-util/e-util-private.h"
-#include "mail/e-mail-junk-options.h"
-#include "widgets/misc/e-charset-combo-box.h"
-#include "widgets/misc/e-signature-editor.h"
-#include "widgets/misc/e-signature-manager.h"
-#include "widgets/misc/e-signature-preview.h"
+#include <e-util/e-util.h>
+#include <e-util/e-util-private.h>
+#include <misc/e-charset-combo-box.h>
+#include <misc/e-signature-editor.h>
+#include <misc/e-signature-manager.h>
+#include <misc/e-signature-preview.h>
#include "em-config.h"
#include "em-folder-selection-button.h"
+#include "e-mail-junk-options.h"
G_DEFINE_TYPE (
EMComposerPrefs,
@@ -132,14 +132,17 @@ transform_new_to_old_reply_style (GBinding *binding,
}
static void
-composer_prefs_finalize (GObject *object)
+composer_prefs_dispose (GObject *object)
{
EMComposerPrefs *prefs = (EMComposerPrefs *) object;
- g_object_unref (prefs->builder);
+ if (prefs->builder != NULL) {
+ g_object_unref (prefs->builder);
+ prefs->builder = NULL;
+ }
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (em_composer_prefs_parent_class)->finalize (object);
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (em_composer_prefs_parent_class)->dispose (object);
}
static void
@@ -148,7 +151,7 @@ em_composer_prefs_class_init (EMComposerPrefsClass *class)
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (class);
- object_class->finalize = composer_prefs_finalize;
+ object_class->dispose = composer_prefs_dispose;
}
static void
@@ -538,7 +541,8 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
/* Signatures */
signature_list = e_get_signature_list ();
- container = e_builder_get_widget (prefs->builder, "signature-alignment");
+ container = e_builder_get_widget (
+ prefs->builder, "signature-alignment");
widget = e_signature_manager_new (signature_list);
gtk_container_add (GTK_CONTAINER (container), widget);
gtk_widget_show (widget);
@@ -589,9 +593,10 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
GtkWidget *
em_composer_prefs_new (EPreferencesWindow *window)
{
+ EShell *shell;
EMComposerPrefs *prefs;
- EShell *shell = e_preferences_window_get_shell (window);
+ shell = e_preferences_window_get_shell (window);
g_return_val_if_fail (E_IS_SHELL (shell), NULL);
prefs = g_object_new (EM_TYPE_COMPOSER_PREFS, NULL);
diff --git a/modules/mail/em-composer-prefs.h b/modules/mail/em-composer-prefs.h
index f39af57c4e..79a53bb775 100644
--- a/modules/mail/em-composer-prefs.h
+++ b/modules/mail/em-composer-prefs.h
@@ -76,8 +76,8 @@ struct _EMComposerPrefsClass {
GtkVBoxClass parent_class;
};
-GType em_composer_prefs_get_type (void);
-GtkWidget *em_composer_prefs_new (EPreferencesWindow *window);
+GType em_composer_prefs_get_type (void);
+GtkWidget * em_composer_prefs_new (EPreferencesWindow *window);
G_END_DECLS