aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-29 06:02:27 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-29 06:08:56 +0800
commitf3fff4c7103b79c9b5b70948fd7d6de949f561a7 (patch)
tree3c252aeb3f7c560c707db9223b4550f8d12f412b /mail
parentde752b010fb47177e91b0fdaba86b8bed0953a23 (diff)
downloadgsoc2013-evolution-f3fff4c7103b79c9b5b70948fd7d6de949f561a7.tar
gsoc2013-evolution-f3fff4c7103b79c9b5b70948fd7d6de949f561a7.tar.gz
gsoc2013-evolution-f3fff4c7103b79c9b5b70948fd7d6de949f561a7.tar.bz2
gsoc2013-evolution-f3fff4c7103b79c9b5b70948fd7d6de949f561a7.tar.lz
gsoc2013-evolution-f3fff4c7103b79c9b5b70948fd7d6de949f561a7.tar.xz
gsoc2013-evolution-f3fff4c7103b79c9b5b70948fd7d6de949f561a7.tar.zst
gsoc2013-evolution-f3fff4c7103b79c9b5b70948fd7d6de949f561a7.zip
EMFolderTreeModel: Miscellaneous cleanups.
Diffstat (limited to 'mail')
-rw-r--r--mail/em-folder-tree-model.c56
1 files changed, 13 insertions, 43 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index b6b8833f47..7c4bbeb938 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -1008,8 +1008,6 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model,
GtkTreeIter root, iter;
GtkTreePath *path;
CamelURL *service_url;
- EAccount *account;
- const gchar *uid;
gchar *uri;
g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model));
@@ -1025,9 +1023,6 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model,
service_url = camel_service_get_camel_url (CAMEL_SERVICE (store));
uri = camel_url_to_string (service_url, CAMEL_URL_HIDE_ALL);
- uid = camel_service_get_uid (CAMEL_SERVICE (store));
- account = e_get_account_by_uid (uid);
-
/* Add the store to the tree. */
gtk_tree_store_append (tree_store, &iter, NULL);
gtk_tree_store_set (
@@ -1093,20 +1088,13 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model,
gtk_tree_path_free (path);
}
-static void
-em_folder_tree_model_remove_uri (EMFolderTreeModel *model, const gchar *uri)
-{
- g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model));
- g_return_if_fail (uri != NULL);
-
- g_hash_table_remove (model->priv->uri_index, uri);
-}
-
-static void
-em_folder_tree_model_remove_store_info (EMFolderTreeModel *model,
- CamelStore *store)
+void
+em_folder_tree_model_remove_store (EMFolderTreeModel *model,
+ CamelStore *store)
{
EMFolderTreeModelStoreInfo *si;
+ GtkTreePath *path;
+ GtkTreeIter iter;
g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model));
g_return_if_fail (CAMEL_IS_STORE (store));
@@ -1115,7 +1103,12 @@ em_folder_tree_model_remove_store_info (EMFolderTreeModel *model,
if (si == NULL)
return;
- g_hash_table_remove (model->priv->store_index, si->store);
+ path = gtk_tree_row_reference_get_path (si->row);
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
+ gtk_tree_path_free (path);
+
+ /* recursively remove subfolders and finally the toplevel store */
+ em_folder_tree_model_remove_folders (model, si, &iter);
}
void
@@ -1147,40 +1140,17 @@ em_folder_tree_model_remove_folders (EMFolderTreeModel *model,
g_hash_table_remove (si->full_hash, full_name);
if (uri != NULL)
- em_folder_tree_model_remove_uri (model, uri);
+ g_hash_table_remove (model->priv->uri_index, uri);
gtk_tree_store_remove ((GtkTreeStore *) model, toplevel);
if (is_store)
- em_folder_tree_model_remove_store_info (model, si->store);
+ g_hash_table_remove (model->priv->store_index, si->store);
g_free (full_name);
g_free (uri);
}
-void
-em_folder_tree_model_remove_store (EMFolderTreeModel *model,
- CamelStore *store)
-{
- EMFolderTreeModelStoreInfo *si;
- GtkTreePath *path;
- GtkTreeIter iter;
-
- g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model));
- g_return_if_fail (CAMEL_IS_STORE (store));
-
- si = em_folder_tree_model_lookup_store_info (model, store);
- if (si == NULL)
- return;
-
- path = gtk_tree_row_reference_get_path (si->row);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
- gtk_tree_path_free (path);
-
- /* recursively remove subfolders and finally the toplevel store */
- em_folder_tree_model_remove_folders (model, si, &iter);
-}
-
gboolean
em_folder_tree_model_is_type_inbox (EMFolderTreeModel *model,
CamelStore *store,