[evolution] Make em_folder_tree_model_lookup_store_info() private.



commit 01b128727a35ea0b1c507f196be820b26bbedd75
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Nov 19 10:51:56 2013 -0500

    Make em_folder_tree_model_lookup_store_info() private.
    
    Only called from within EMFolderTreeModel itself.
    
    Working toward making the EMFolderTreeModelStoreInfo struct private to
    EMFolderTreeModel, so it can then be made thread-safe.

 mail/em-folder-tree-model.c |   37 ++++++++++++++++++-------------------
 mail/em-folder-tree-model.h |    4 ----
 2 files changed, 18 insertions(+), 23 deletions(-)
---
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 2014b04..97f6cbe 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -114,6 +114,15 @@ store_info_free (EMFolderTreeModelStoreInfo *si)
        g_free (si);
 }
 
+static EMFolderTreeModelStoreInfo *
+folder_tree_model_lookup_store_info (EMFolderTreeModel *model,
+                                     CamelStore *store)
+{
+       g_return_val_if_fail (CAMEL_IS_STORE (store), NULL);
+
+       return g_hash_table_lookup (model->priv->store_index, store);
+}
+
 static gint
 folder_tree_model_sort (GtkTreeModel *model,
                         GtkTreeIter *a,
@@ -488,7 +497,7 @@ folder_tree_model_set_unread_count (EMFolderTreeModel *model,
        if (unread < 0)
                return;
 
-       si = em_folder_tree_model_lookup_store_info (model, store);
+       si = folder_tree_model_lookup_store_info (model, store);
        if (si == NULL)
                return;
 
@@ -971,7 +980,7 @@ folder_tree_model_folder_subscribed_cb (CamelStore *store,
        gboolean load;
        gchar *dirname, *p;
 
-       si = em_folder_tree_model_lookup_store_info (model, store);
+       si = folder_tree_model_lookup_store_info (model, store);
        if (si == NULL)
                return;
 
@@ -1020,7 +1029,7 @@ folder_tree_model_folder_unsubscribed_cb (CamelStore *store,
        GtkTreePath *path;
        GtkTreeIter iter;
 
-       si = em_folder_tree_model_lookup_store_info (model, store);
+       si = folder_tree_model_lookup_store_info (model, store);
        if (si == NULL)
                return;
 
@@ -1048,7 +1057,7 @@ folder_tree_model_folder_created_cb (CamelStore *store,
                return;
 
        /* process "folder-created" event only when store already loaded */
-       si = em_folder_tree_model_lookup_store_info (model, store);
+       si = folder_tree_model_lookup_store_info (model, store);
        if (si == NULL || g_hash_table_size (si->full_hash) == 0)
                return;
 
@@ -1080,7 +1089,7 @@ folder_tree_model_folder_renamed_cb (CamelStore *store,
        GtkTreePath *path;
        gchar *parent, *p;
 
-       si = em_folder_tree_model_lookup_store_info (model, store);
+       si = folder_tree_model_lookup_store_info (model, store);
        if (si == NULL)
                return;
 
@@ -1172,7 +1181,7 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model,
        uri = camel_url_to_string (service_url, CAMEL_URL_HIDE_ALL);
        camel_url_free (service_url);
 
-       si = em_folder_tree_model_lookup_store_info (model, store);
+       si = folder_tree_model_lookup_store_info (model, store);
        if (si != NULL)
                em_folder_tree_model_remove_store (model, store);
 
@@ -1267,7 +1276,7 @@ em_folder_tree_model_remove_store (EMFolderTreeModel *model,
        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);
+       si = folder_tree_model_lookup_store_info (model, store);
        if (si == NULL)
                return;
 
@@ -1302,7 +1311,7 @@ em_folder_tree_model_is_type_inbox (EMFolderTreeModel *model,
        g_return_val_if_fail (CAMEL_IS_STORE (store), FALSE);
        g_return_val_if_fail (full != NULL, FALSE);
 
-       si = em_folder_tree_model_lookup_store_info (model, store);
+       si = folder_tree_model_lookup_store_info (model, store);
        if (si == NULL)
                return FALSE;
 
@@ -1336,7 +1345,7 @@ em_folder_tree_model_get_folder_name (EMFolderTreeModel *model,
        g_return_val_if_fail (CAMEL_IS_STORE (store), NULL);
        g_return_val_if_fail (full != NULL, NULL);
 
-       si = em_folder_tree_model_lookup_store_info (model, store);
+       si = folder_tree_model_lookup_store_info (model, store);
        if (si == NULL)
                return g_strdup (full);
 
@@ -1355,16 +1364,6 @@ em_folder_tree_model_get_folder_name (EMFolderTreeModel *model,
        return name;
 }
 
-EMFolderTreeModelStoreInfo *
-em_folder_tree_model_lookup_store_info (EMFolderTreeModel *model,
-                                        CamelStore *store)
-{
-       g_return_val_if_fail (EM_IS_FOLDER_TREE_MODEL (model), NULL);
-       g_return_val_if_fail (CAMEL_IS_STORE (store), NULL);
-
-       return g_hash_table_lookup (model->priv->store_index, store);
-}
-
 /**
  * em_folder_tree_model_get_row_reference:
  * @model: an #EMFolderTreeModel
diff --git a/mail/em-folder-tree-model.h b/mail/em-folder-tree-model.h
index 75ef93f..35c8531 100644
--- a/mail/em-folder-tree-model.h
+++ b/mail/em-folder-tree-model.h
@@ -145,10 +145,6 @@ gchar *            em_folder_tree_model_get_folder_name
                                        (EMFolderTreeModel *model,
                                         CamelStore *store,
                                         const gchar *full);
-EMFolderTreeModelStoreInfo *
-               em_folder_tree_model_lookup_store_info
-                                       (EMFolderTreeModel *model,
-                                        CamelStore *store);
 GtkTreeRowReference *
                em_folder_tree_model_get_row_reference
                                        (EMFolderTreeModel *model,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]