diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-12-16 23:40:37 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-12-16 23:58:54 +0800 |
commit | a9cfed5938aef37d95c009411f965ebc185547c1 (patch) | |
tree | d0c6eb1d5acea6752425169aae47e8f4ed4b55ea /mail/em-filter-context.c | |
parent | df85cb1b7a47f713cb775f648f735e642a1bb71b (diff) | |
download | gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.gz gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.bz2 gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.lz gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.xz gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.zst gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.zip |
Avoid passing EMailBackend as much as possible.
More mail API churn... reversing some previous API decisions.
I've made some key API changes to EMailSession on the account-mgmt
branch which should allow for this, and will hopefully also benefit
the "email-factory" branch.
EMailBackend barely needs to exist anymore, except as the owner of
EMailSession.
For several low-level functions, we replace its EMailBackend parameter
with EMailSession and EAlertSink parameters; the latter so it can still
pass user alerts up the chain.
Diffstat (limited to 'mail/em-filter-context.c')
-rw-r--r-- | mail/em-filter-context.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/mail/em-filter-context.c b/mail/em-filter-context.c index 085c32dbd0..6a5822c7a1 100644 --- a/mail/em-filter-context.c +++ b/mail/em-filter-context.c @@ -41,13 +41,13 @@ ((obj), EM_TYPE_FILTER_CONTEXT, EMFilterContextPrivate)) struct _EMFilterContextPrivate { - EMailBackend *backend; + EMailSession *session; GList *actions; }; enum { PROP_0, - PROP_BACKEND + PROP_SESSION }; G_DEFINE_TYPE ( @@ -56,13 +56,13 @@ G_DEFINE_TYPE ( E_TYPE_RULE_CONTEXT) static void -filter_context_set_backend (EMFilterContext *context, - EMailBackend *backend) +filter_context_set_session (EMFilterContext *context, + EMailSession *session) { - g_return_if_fail (E_IS_MAIL_BACKEND (backend)); - g_return_if_fail (context->priv->backend == NULL); + g_return_if_fail (E_IS_MAIL_SESSION (session)); + g_return_if_fail (context->priv->session == NULL); - context->priv->backend = g_object_ref (backend); + context->priv->session = g_object_ref (session); } static void @@ -72,8 +72,8 @@ filter_context_set_property (GObject *object, GParamSpec *pspec) { switch (property_id) { - case PROP_BACKEND: - filter_context_set_backend ( + case PROP_SESSION: + filter_context_set_session ( EM_FILTER_CONTEXT (object), g_value_get_object (value)); return; @@ -89,10 +89,10 @@ filter_context_get_property (GObject *object, GParamSpec *pspec) { switch (property_id) { - case PROP_BACKEND: + case PROP_SESSION: g_value_set_object ( value, - em_filter_context_get_backend ( + em_filter_context_get_session ( EM_FILTER_CONTEXT (object))); return; } @@ -107,9 +107,9 @@ filter_context_dispose (GObject *object) priv = EM_FILTER_CONTEXT_GET_PRIVATE (object); - if (priv->backend != NULL) { - g_object_unref (priv->backend); - priv->backend = NULL; + if (priv->session != NULL) { + g_object_unref (priv->session); + priv->session = NULL; } g_list_foreach (priv->actions, (GFunc) g_object_unref, NULL); @@ -236,7 +236,7 @@ filter_context_new_element (ERuleContext *context, priv = EM_FILTER_CONTEXT_GET_PRIVATE (context); if (strcmp (type, "folder") == 0) - return em_filter_folder_element_new (priv->backend); + return em_filter_folder_element_new (priv->session); if (strcmp (type, "system-flag") == 0) return e_filter_option_new (); @@ -245,7 +245,7 @@ filter_context_new_element (ERuleContext *context, return e_filter_int_new_type ("score", -3, 3); if (strcmp (type, "source") == 0) - return em_filter_source_element_new (priv->backend); + return em_filter_source_element_new (priv->session); return E_RULE_CONTEXT_CLASS (em_filter_context_parent_class)-> new_element (context, type); @@ -271,12 +271,12 @@ em_filter_context_class_init (EMFilterContextClass *class) g_object_class_install_property ( object_class, - PROP_BACKEND, + PROP_SESSION, g_param_spec_object ( - "backend", + "session", NULL, NULL, - E_TYPE_MAIL_BACKEND, + E_TYPE_MAIL_SESSION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); } @@ -306,20 +306,20 @@ em_filter_context_init (EMFilterContext *context) } EMFilterContext * -em_filter_context_new (EMailBackend *backend) +em_filter_context_new (EMailSession *session) { - g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL); + g_return_val_if_fail (E_IS_MAIL_SESSION (session), NULL); return g_object_new ( - EM_TYPE_FILTER_CONTEXT, "backend", backend, NULL); + EM_TYPE_FILTER_CONTEXT, "session", session, NULL); } -EMailBackend * -em_filter_context_get_backend (EMFilterContext *context) +EMailSession * +em_filter_context_get_session (EMFilterContext *context) { g_return_val_if_fail (EM_IS_FILTER_CONTEXT (context), NULL); - return context->priv->backend; + return context->priv->session; } void |