diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-28 21:36:33 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-28 21:51:25 +0800 |
commit | 2988537fb0fd7ea5547c274a3660ebd41a2514e2 (patch) | |
tree | bd5538131bc3a432af096679694a4fcc38009f01 | |
parent | 62066e2c17cf0239966f4d03b0fa51c58a94f27a (diff) | |
download | gsoc2013-evolution-2988537fb0fd7ea5547c274a3660ebd41a2514e2.tar.gz gsoc2013-evolution-2988537fb0fd7ea5547c274a3660ebd41a2514e2.tar.zst gsoc2013-evolution-2988537fb0fd7ea5547c274a3660ebd41a2514e2.zip |
Remove account from EMFolderTreeModelStoreInfo.
The struct already has a CamelStore, and the CamelStore UID is the same
as the EAccount UID, so it's easy to lookup the corresponding EAccount.
-rw-r--r-- | mail/em-folder-tree-model.c | 16 | ||||
-rw-r--r-- | mail/em-folder-tree-model.h | 1 |
2 files changed, 10 insertions, 7 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 0609bb9783..b6b8833f47 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -632,6 +632,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeStore *tree_store; MailFolderCache *folder_cache; EMailSession *session; + EAccount *account; guint unread; GtkTreePath *path; GtkTreeIter sub; @@ -640,6 +641,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, gboolean is_templates = FALSE; CamelFolder *folder; gboolean emitted = FALSE; + const gchar *uid; const gchar *icon_name; const gchar *display_name; guint32 flags, add_flags = 0; @@ -655,6 +657,9 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, session = em_folder_tree_model_get_session (model); folder_cache = e_mail_session_get_folder_cache (session); + uid = camel_service_get_uid (CAMEL_SERVICE (si->store)); + account = e_get_account_by_uid (uid); + if (!fully_loaded) load = (fi->child == NULL) && !(fi->flags & (CAMEL_FOLDER_NOCHILDREN | CAMEL_FOLDER_NOINFERIORS)); @@ -723,17 +728,17 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, } } - if (si->account && (flags & CAMEL_FOLDER_TYPE_MASK) == 0) { - if (!is_drafts && si->account->drafts_folder_uri) { + if (account != NULL && (flags & CAMEL_FOLDER_TYPE_MASK) == 0) { + if (!is_drafts && account->drafts_folder_uri != NULL) { is_drafts = e_mail_folder_uri_equal ( CAMEL_SESSION (session), uri, - si->account->drafts_folder_uri); + account->drafts_folder_uri); } - if (si->account->sent_folder_uri) { + if (account->sent_folder_uri != NULL) { if (e_mail_folder_uri_equal ( CAMEL_SESSION (session), uri, - si->account->sent_folder_uri)) { + account->sent_folder_uri)) { add_flags = CAMEL_FOLDER_TYPE_SENT; } } @@ -1039,7 +1044,6 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model, si = g_new (EMFolderTreeModelStoreInfo, 1); si->store = g_object_ref (store); - si->account = account; si->row = gtk_tree_row_reference_copy (reference); si->full_hash = g_hash_table_new_full ( g_str_hash, g_str_equal, diff --git a/mail/em-folder-tree-model.h b/mail/em-folder-tree-model.h index 367f90d91c..419323ab6c 100644 --- a/mail/em-folder-tree-model.h +++ b/mail/em-folder-tree-model.h @@ -82,7 +82,6 @@ struct _EMFolderTreeModelStoreInfo { /* CamelFolderInfo::full_name -> GtkTreeRowReference */ GHashTable *full_hash; - EAccount *account; guint created_id; guint deleted_id; |