[evolution/email-factory-3-4: 38/38] Fix minor issues.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/email-factory-3-4: 38/38] Fix minor issues.
- Date: Fri, 16 Dec 2011 11:57:39 +0000 (UTC)
commit 418251a7495f71d9eca8a4337ffb12aa8ad48496
Author: Srinivasa Ragavan <sragavan gnome org>
Date: Fri Dec 16 17:17:22 2011 +0530
Fix minor issues.
libemail-engine/e-mail-session.h | 3 -
mail/e-mail-account-store.c | 6 +-
mail/e-mail-ui-session.c | 34 +++++----
mail/e-mail-ui-session.h | 4 +-
modules/mail/e-mail-shell-backend.c | 2 +-
modules/mail/e-mail-shell-view-actions.c | 2 +-
modules/mail/em-account-prefs.c | 120 +-----------------------------
7 files changed, 26 insertions(+), 145 deletions(-)
---
diff --git a/libemail-engine/e-mail-session.h b/libemail-engine/e-mail-session.h
index 019d49d..af7892d 100644
--- a/libemail-engine/e-mail-session.h
+++ b/libemail-engine/e-mail-session.h
@@ -54,9 +54,6 @@
G_BEGIN_DECLS
-/* Avoids a circular dependency. */
-typedef struct _EMailAccountStore EMailAccountStore;
-
typedef struct _EMailSession EMailSession;
typedef struct _EMailSessionClass EMailSessionClass;
typedef struct _EMailSessionPrivate EMailSessionPrivate;
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c
index 2a473e7..b838501 100644
--- a/mail/e-mail-account-store.c
+++ b/mail/e-mail-account-store.c
@@ -24,10 +24,10 @@
#include <libebackend/e-extensible.h>
-#include <e-util/e-marshal.h>
-#include <e-util/e-account-utils.h>
+#include <libemail-utils/e-marshal.h>
+#include <libemail-utils/e-account-utils.h>
#include <e-util/e-alert-dialog.h>
-#include <mail/mail-ops.h>
+#include <libemail-engine/mail-ops.h>
#include <mail/mail-vfolder.h>
#define E_MAIL_ACCOUNT_STORE_GET_PRIVATE(obj) \
diff --git a/mail/e-mail-ui-session.c b/mail/e-mail-ui-session.c
index 71259da..1ecf488 100644
--- a/mail/e-mail-ui-session.c
+++ b/mail/e-mail-ui-session.c
@@ -431,13 +431,13 @@ mail_ui_session_finalize (GObject *object)
}
static void
-mail_session_add_vfolder_store (EMailUISession *uisession)
+mail_ui_session_add_vfolder_store (EMailUISession *uisession)
{
CamelSession *camel_session;
CamelService *service;
GError *error = NULL;
- camel_session = CAMEL_SESSION (session);
+ camel_session = CAMEL_SESSION (uisession);
service = camel_session_add_service (
camel_session, E_MAIL_SESSION_VFOLDER_UID,
@@ -459,7 +459,7 @@ mail_session_add_vfolder_store (EMailUISession *uisession)
* to from here, so it has to be called from elsewhere. Kinda
* thinking about reworking that... */
- session->priv->vfolder_store = g_object_ref (service);
+ uisession->priv->vfolder_store = g_object_ref (service);
}
static void
@@ -511,19 +511,19 @@ mail_ui_session_constructed (GObject *object)
EMailUISessionPrivate *priv;
EMFolderTreeModel *folder_tree_model;
EMailSession *session;
- EMailUISession *session;
+ EMailUISession *uisession;
EAccount *account;
EAccountList *account_list;
gulong handler_id;
session = E_MAIL_SESSION (object);
uisession = E_MAIL_UI_SESSION(object);
- priv = E_MAIL_UI_SESSION_GET_PRIVATE (object);
+ uisession->priv = priv = E_MAIL_UI_SESSION_GET_PRIVATE (object);
priv->account_store = e_mail_account_store_new (session);
account_list = e_get_account_list ();
- session->priv->account_list = g_object_ref (account_list);
+ uisession->priv->account_list = g_object_ref (account_list);
/* XXX Make sure the folder tree model is created before we
* add built-in CamelStores so it gets signals from the
@@ -535,12 +535,13 @@ mail_ui_session_constructed (GObject *object)
* FIXME EMailSession should just own the default instance.
*/
folder_tree_model = em_folder_tree_model_get_default ();
- em_folder_tree_model_set_session (folder_tree_model, session);
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (e_mail_ui_session_parent_class)->constructed (object);
- mail_session_add_vfolder_store (session);
+ em_folder_tree_model_set_session (folder_tree_model, session);
+
+ mail_ui_session_add_vfolder_store (uisession);
/* Initialize which account is default. */
account = e_get_default_account ();
@@ -621,7 +622,7 @@ mail_ui_session_set_property (GObject *object,
}
static void
-mail_session_get_property (GObject *object,
+mail_ui_session_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
@@ -631,14 +632,14 @@ mail_session_get_property (GObject *object,
g_value_set_object (
value,
e_mail_ui_session_get_account_store (
- E_MAIL_SESSION (object)));
+ E_MAIL_UI_SESSION (object)));
return;
case PROP_VFOLDER_STORE:
g_value_set_object (
value,
- e_mail_session_get_vfolder_store (
- E_MAIL_SESSION (object)));
+ e_mail_ui_session_get_vfolder_store (
+ E_MAIL_UI_SESSION (object)));
return;
}
@@ -647,7 +648,7 @@ mail_session_get_property (GObject *object,
typedef struct _SourceContext SourceContext;
struct _SourceContext {
- EMailSession *session;
+ EMailUISession *session;
CamelService *service;
};
@@ -675,7 +676,7 @@ source_context_free (SourceContext *context)
}
static CamelService *
-mail_session_add_service (CamelSession *session,
+mail_ui_session_add_service (CamelSession *session,
const gchar *uid,
const gchar *protocol,
CamelProviderType type,
@@ -684,7 +685,7 @@ mail_session_add_service (CamelSession *session,
CamelService *service;
/* Chain up to parent's constructed() method. */
- service = G_OBJECT_CLASS (e_mail_ui_session_parent_class)->add_service (object);
+ service = CAMEL_SESSION_CLASS (e_mail_ui_session_parent_class)->add_service (session, uid, protocol, type, error);
/* Inform the EMailAccountStore of the new CamelService
* from an idle callback so the service has a chance to
@@ -698,10 +699,11 @@ mail_session_add_service (CamelSession *session,
g_idle_add_full (
G_PRIORITY_DEFAULT_IDLE,
- (GSourceFunc) mail_session_add_service_cb,
+ (GSourceFunc) mail_ui_session_add_service_cb,
context, (GDestroyNotify) source_context_free);
}
+ return service;
}
static void
diff --git a/mail/e-mail-ui-session.h b/mail/e-mail-ui-session.h
index d6cb565..3bc9302 100644
--- a/mail/e-mail-ui-session.h
+++ b/mail/e-mail-ui-session.h
@@ -70,10 +70,10 @@ struct _EMailUISessionClass {
GType e_mail_ui_session_get_type (void);
EMailSession * e_mail_ui_session_new (void);
CamelStore * e_mail_ui_session_get_vfolder_store
- (EMailSession *session);
+ (EMailUISession *session);
EMailAccountStore *
e_mail_ui_session_get_account_store
- (EMailSession *session);
+ (EMailUISession *session);
G_END_DECLS
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 0a2731e..21e8dcf 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -470,7 +470,7 @@ mail_shell_backend_start (EShellBackend *shell_backend)
backend = E_MAIL_BACKEND (shell_backend);
session = e_mail_backend_get_session (backend);
- account_store = e_mail_ui_session_get_account_store (session);
+ account_store = e_mail_ui_session_get_account_store ((EMailUISession *)session);
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 c81f53b..8b5fe23 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -99,7 +99,7 @@ action_mail_account_disable_cb (GtkAction *action,
backend = E_MAIL_BACKEND (shell_backend);
session = e_mail_backend_get_session (backend);
- account_store = e_mail_ui_session_get_account_store (session);
+ account_store = e_mail_ui_session_get_account_store ((EMailUISession *) session);
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
store = em_folder_tree_get_selected_store (folder_tree);
diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c
index befdeab..a5e04cd 100644
--- a/modules/mail/em-account-prefs.c
+++ b/modules/mail/em-account-prefs.c
@@ -65,72 +65,12 @@ G_DEFINE_TYPE (
E_TYPE_MAIL_ACCOUNT_MANAGER)
static void
-<<<<<<< HEAD
account_prefs_service_enabled_cb (EMailAccountStore *store,
CamelService *service,
EMAccountPrefs *prefs)
{
EMailBackend *backend;
const gchar *uid;
-=======
-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) {
- if (account_prefs_toggle_enable_special (prefs, e_account_tree_view_get_selected_type (tree_view), TRUE))
- return;
- }
-
- g_return_if_fail (account != NULL);
- session = e_mail_backend_get_session (prefs->priv->backend);
- e_mail_store_add_by_account (session, account);
-}
-
-static void
-account_prefs_disable_account_cb (EAccountTreeView *tree_view,
- EMAccountPrefs *prefs)
-{
- EMailSession *session;
- EAccountList *account_list;
- EAccount *account;
- gpointer parent;
- gint response;
-
- session = e_mail_backend_get_session (prefs->priv->backend);
-
- account = e_account_tree_view_get_selected (tree_view);
- if (!account) {
- if (account_prefs_toggle_enable_special (prefs, e_account_tree_view_get_selected_type (tree_view), FALSE))
- return;
- }
-
- g_return_if_fail (account != NULL);
-
- session = e_mail_backend_get_session (prefs->priv->backend);
-
- account_list = e_account_tree_view_get_account_list (tree_view);
- g_return_if_fail (account_list != NULL);
-
- if (!e_account_list_account_has_proxies (account_list, account)) {
- e_mail_store_remove_by_account (session, account);
- return;
- }
-
- parent = gtk_widget_get_toplevel (GTK_WIDGET (tree_view));
- parent = gtk_widget_is_toplevel (parent) ? parent : NULL;
-
- response = e_alert_run_dialog_for_args (
- parent, "mail:ask-delete-proxy-accounts", NULL);
-
- if (response != GTK_RESPONSE_YES) {
- g_signal_stop_emission_by_name (tree_view, "disable-account");
- return;
- }
->>>>>>> Port Evolution to EDS's new mail library.
uid = camel_service_get_uid (service);
backend = em_account_prefs_get_backend (prefs);
@@ -317,64 +257,6 @@ account_prefs_edit_account (EMailAccountManager *manager,
}
static void
-<<<<<<< HEAD
-=======
-account_prefs_delete_account (EAccountManager *manager)
-{
- EMAccountPrefsPrivate *priv;
- EAccountTreeView *tree_view;
- EAccountList *account_list;
- EAccount *account;
- EMailSession *session;
- gboolean has_proxies;
- gpointer parent;
- gint response;
-
- priv = EM_ACCOUNT_PREFS (manager)->priv;
- session = e_mail_backend_get_session (priv->backend);
-
- 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);
- account = e_account_tree_view_get_selected (tree_view);
- g_return_if_fail (account != NULL);
-
- /* Make sure we aren't editing anything... */
- if (priv->editor != NULL)
- return;
-
- parent = gtk_widget_get_toplevel (GTK_WIDGET (manager));
- parent = gtk_widget_is_toplevel (parent) ? parent : NULL;
-
- has_proxies =
- e_account_list_account_has_proxies (account_list, account);
-
- response = e_alert_run_dialog_for_args (
- parent, has_proxies ?
- "mail:ask-delete-account-with-proxies" :
- "mail:ask-delete-account", NULL);
-
- if (response != GTK_RESPONSE_YES) {
- g_signal_stop_emission_by_name (manager, "delete-account");
- return;
- }
-
- /* Remove the account from the folder tree. */
- if (account->enabled)
- e_mail_store_remove_by_account (session, account);
-
- /* Remove all the proxies the account has created. */
- if (has_proxies)
- e_account_list_remove_account_proxies (account_list, account);
-
- /* Remove it from the config file. */
- e_account_list_remove (account_list, account);
-
- e_account_list_save (account_list);
-}
-
-static void
->>>>>>> Port Evolution to EDS's new mail library.
em_account_prefs_class_init (EMAccountPrefsClass *class)
{
GObjectClass *object_class;
@@ -423,7 +305,7 @@ em_account_prefs_new (EPreferencesWindow *window)
shell_backend = e_shell_get_backend_by_name (shell, "mail");
session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend));
- account_store = e_mail_ui_session_get_account_store (session);
+ account_store = e_mail_ui_session_get_account_store ((EMailUISession *)session);
return g_object_new (
EM_TYPE_ACCOUNT_PREFS,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]