aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-27 04:54:27 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-27 23:59:54 +0800
commit8e20704597de1df409d880ef84dff160af8a0b2a (patch)
tree3d90116ede012d16623b8d5cdb7c22fc05d103b6 /mail
parentd2f53b4b8f888d32c42918e842d5847966e828ce (diff)
downloadgsoc2013-evolution-8e20704597de1df409d880ef84dff160af8a0b2a.tar
gsoc2013-evolution-8e20704597de1df409d880ef84dff160af8a0b2a.tar.gz
gsoc2013-evolution-8e20704597de1df409d880ef84dff160af8a0b2a.tar.bz2
gsoc2013-evolution-8e20704597de1df409d880ef84dff160af8a0b2a.tar.lz
gsoc2013-evolution-8e20704597de1df409d880ef84dff160af8a0b2a.tar.xz
gsoc2013-evolution-8e20704597de1df409d880ef84dff160af8a0b2a.tar.zst
gsoc2013-evolution-8e20704597de1df409d880ef84dff160af8a0b2a.zip
EMailUISession: Add a read-only "photo-cache" property.
New functions: e_mail_ui_session_get_photo_cache()
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-ui-session.c39
-rw-r--r--mail/e-mail-ui-session.h2
2 files changed, 40 insertions, 1 deletions
diff --git a/mail/e-mail-ui-session.c b/mail/e-mail-ui-session.c
index b9dc11e9a7..48c1df5bda 100644
--- a/mail/e-mail-ui-session.c
+++ b/mail/e-mail-ui-session.c
@@ -80,12 +80,14 @@ struct _EMailUISessionPrivate {
ESourceRegistry *registry;
EMailAccountStore *account_store;
EMailLabelListStore *label_store;
+ EPhotoCache *photo_cache;
};
enum {
PROP_0,
PROP_ACCOUNT_STORE,
- PROP_LABEL_STORE
+ PROP_LABEL_STORE,
+ PROP_PHOTO_CACHE
};
enum {
@@ -499,6 +501,13 @@ mail_ui_session_get_property (GObject *object,
e_mail_ui_session_get_label_store (
E_MAIL_UI_SESSION (object)));
return;
+
+ case PROP_PHOTO_CACHE:
+ g_value_set_object (
+ value,
+ e_mail_ui_session_get_photo_cache (
+ E_MAIL_UI_SESSION (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -527,6 +536,11 @@ mail_ui_session_dispose (GObject *object)
priv->label_store = NULL;
}
+ if (priv->photo_cache != NULL) {
+ g_object_unref (priv->photo_cache);
+ priv->photo_cache = NULL;
+ }
+
/* Chain up to parent's dispose() method. */
G_OBJECT_CLASS (e_mail_ui_session_parent_class)->dispose (object);
}
@@ -537,6 +551,7 @@ mail_ui_session_constructed (GObject *object)
EMailUISessionPrivate *priv;
EMFolderTreeModel *folder_tree_model;
ESourceRegistry *registry;
+ EClientCache *client_cache;
EMailSession *session;
EShell *shell;
@@ -557,6 +572,9 @@ mail_ui_session_constructed (GObject *object)
registry = e_mail_session_get_registry (session);
priv->registry = g_object_ref (registry);
+ client_cache = e_shell_get_client_cache (shell);
+ priv->photo_cache = e_photo_cache_new (client_cache);
+
/* XXX Make sure the folder tree model is created before we
* add built-in CamelStores so it gets signals from the
* EMailAccountStore.
@@ -731,6 +749,17 @@ e_mail_ui_session_class_init (EMailUISessionClass *class)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (
+ object_class,
+ PROP_PHOTO_CACHE,
+ g_param_spec_object (
+ "photo-cache",
+ "Photo Cache",
+ "Contact photo cache",
+ E_TYPE_PHOTO_CACHE,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
signals[ACTIVITY_ADDED] = g_signal_new (
"activity-added",
G_OBJECT_CLASS_TYPE (class),
@@ -784,6 +813,14 @@ e_mail_ui_session_get_label_store (EMailUISession *session)
return session->priv->label_store;
}
+EPhotoCache *
+e_mail_ui_session_get_photo_cache (EMailUISession *session)
+{
+ g_return_val_if_fail (E_IS_MAIL_UI_SESSION (session), NULL);
+
+ return session->priv->photo_cache;
+}
+
void
e_mail_ui_session_add_activity (EMailUISession *session,
EActivity *activity)
diff --git a/mail/e-mail-ui-session.h b/mail/e-mail-ui-session.h
index efd4696023..c199a7b334 100644
--- a/mail/e-mail-ui-session.h
+++ b/mail/e-mail-ui-session.h
@@ -82,6 +82,8 @@ EMailAccountStore *
EMailLabelListStore *
e_mail_ui_session_get_label_store
(EMailUISession *session);
+EPhotoCache * e_mail_ui_session_get_photo_cache
+ (EMailUISession *session);
void e_mail_ui_session_add_activity (EMailUISession *session,
EActivity *activity);
gint e_mail_ui_session_alert_user (CamelSession *session,