aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-subscription-editor.c
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 /mail/em-subscription-editor.c
parentc520043a094d81d222aa0c3e23b0035ddb89d0bf (diff)
downloadgsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.gz
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.bz2
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.lz
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.xz
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 'mail/em-subscription-editor.c')
-rw-r--r--mail/em-subscription-editor.c59
1 files changed, 31 insertions, 28 deletions
diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c
index e2452d70bf..09b74bcb3c 100644
--- a/mail/em-subscription-editor.c
+++ b/mail/em-subscription-editor.c
@@ -51,7 +51,7 @@ typedef struct _AsyncContext AsyncContext;
typedef struct _StoreData StoreData;
struct _EMSubscriptionEditorPrivate {
- CamelSession *session;
+ EMailBackend *backend;
CamelStore *initial_store;
GtkWidget *combo_box; /* not referenced */
@@ -95,7 +95,7 @@ struct _StoreData {
enum {
PROP_0,
- PROP_SESSION,
+ PROP_BACKEND,
PROP_STORE
};
@@ -932,13 +932,13 @@ subscription_editor_set_store (EMSubscriptionEditor *editor,
}
static void
-subscription_editor_set_session (EMSubscriptionEditor *editor,
- CamelSession *session)
+subscription_editor_set_backend (EMSubscriptionEditor *editor,
+ EMailBackend *backend)
{
- g_return_if_fail (CAMEL_IS_SESSION (session));
- g_return_if_fail (editor->priv->session == NULL);
+ g_return_if_fail (E_IS_MAIL_BACKEND (backend));
+ g_return_if_fail (editor->priv->backend == NULL);
- editor->priv->session = g_object_ref (session);
+ editor->priv->backend = g_object_ref (backend);
}
static void
@@ -948,8 +948,8 @@ subscription_editor_set_property (GObject *object,
GParamSpec *pspec)
{
switch (property_id) {
- case PROP_SESSION:
- subscription_editor_set_session (
+ case PROP_BACKEND:
+ subscription_editor_set_backend (
EM_SUBSCRIPTION_EDITOR (object),
g_value_get_object (value));
return;
@@ -971,10 +971,10 @@ subscription_editor_get_property (GObject *object,
GParamSpec *pspec)
{
switch (property_id) {
- case PROP_SESSION:
+ case PROP_BACKEND:
g_value_set_object (
value,
- em_subscription_editor_get_session (
+ em_subscription_editor_get_backend (
EM_SUBSCRIPTION_EDITOR (object)));
return;
@@ -996,9 +996,9 @@ subscription_editor_dispose (GObject *object)
priv = EM_SUBSCRIPTION_EDITOR_GET_PRIVATE (object);
- if (priv->session != NULL) {
- g_object_unref (priv->session);
- priv->session = NULL;
+ if (priv->backend != NULL) {
+ g_object_unref (priv->backend);
+ priv->backend = NULL;
}
if (priv->initial_store != NULL) {
@@ -1044,14 +1044,17 @@ subscription_editor_constructed (GObject *object)
if (editor->priv->initial_store == NULL) {
EAccount *account;
CamelService *service;
- CamelSession *session;
- const gchar *uid;
+ EMailBackend *backend;
+ EMailSession *session;
account = e_get_default_account ();
- uid = account->uid;
- session = em_subscription_editor_get_session (editor);
- service = camel_session_get_service (session, uid);
+ backend = em_subscription_editor_get_backend (editor);
+ session = e_mail_backend_get_session (backend);
+
+ service = camel_session_get_service (
+ CAMEL_SESSION (session),
+ account->uid);
if (CAMEL_IS_SUBSCRIBABLE (service))
editor->priv->initial_store = g_object_ref (service);
@@ -1122,12 +1125,12 @@ em_subscription_editor_class_init (EMSubscriptionEditorClass *class)
g_object_class_install_property (
object_class,
- PROP_SESSION,
+ PROP_BACKEND,
g_param_spec_object (
- "session",
+ "backend",
NULL,
NULL,
- CAMEL_TYPE_SESSION,
+ E_TYPE_MAIL_BACKEND,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
@@ -1343,26 +1346,26 @@ em_subscription_editor_init (EMSubscriptionEditor *editor)
GtkWidget *
em_subscription_editor_new (GtkWindow *parent,
- CamelSession *session,
+ EMailBackend *backend,
CamelStore *initial_store)
{
g_return_val_if_fail (GTK_IS_WINDOW (parent), NULL);
- g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
+ g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL);
return g_object_new (
EM_TYPE_SUBSCRIPTION_EDITOR,
- "session", session,
+ "backend", backend,
"store", initial_store,
"transient-for", parent,
NULL);
}
-CamelSession *
-em_subscription_editor_get_session (EMSubscriptionEditor *editor)
+EMailBackend *
+em_subscription_editor_get_backend (EMSubscriptionEditor *editor)
{
g_return_val_if_fail (EM_IS_SUBSCRIPTION_EDITOR (editor), NULL);
- return editor->priv->session;
+ return editor->priv->backend;
}
CamelStore *