aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-28 21:36:33 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:21 +0800
commit63d86c794e104a40e729cedea51d3929f10b0cb9 (patch)
treeab689dd95e865359d3db92a9b312163bd0dd2b39 /mail
parent0fdaf826c241027acb6478b107b4e08dbf042926 (diff)
downloadgsoc2013-evolution-63d86c794e104a40e729cedea51d3929f10b0cb9.tar
gsoc2013-evolution-63d86c794e104a40e729cedea51d3929f10b0cb9.tar.gz
gsoc2013-evolution-63d86c794e104a40e729cedea51d3929f10b0cb9.tar.bz2
gsoc2013-evolution-63d86c794e104a40e729cedea51d3929f10b0cb9.tar.lz
gsoc2013-evolution-63d86c794e104a40e729cedea51d3929f10b0cb9.tar.xz
gsoc2013-evolution-63d86c794e104a40e729cedea51d3929f10b0cb9.tar.zst
gsoc2013-evolution-63d86c794e104a40e729cedea51d3929f10b0cb9.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.
Diffstat (limited to 'mail')
-rw-r--r--mail/em-folder-tree-model.c16
-rw-r--r--mail/em-folder-tree-model.h1
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;