[evolution-data-server] CamelStoreClass: Rename compare_folder_name to equal_folder_name.



commit a69bb0384ad8d8663828b7b79cc52f378d700c8a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Jul 6 21:46:18 2012 -0400

    CamelStoreClass: Rename compare_folder_name to equal_folder_name.
    
    CamelStoreClass has the following method:
    
        GCompareFunc compare_folder_name;
    
    Both the method name and call signature imply this is a strcmp()-style
    function where a zero return value means the values are equal.  But in
    fact this method is used as an equality test where a zero return value
    means the values are NOT equal.
    
    Rename the method and change its call signature like so:
    
        GEqualFunc equal_folder_name;
    
    This is an API break but clearly a necessary one.

 camel/camel-imapx-store.c                   |    4 ++--
 camel/camel-store.c                         |    6 +++---
 camel/camel-store.h                         |    2 +-
 camel/providers/imap/camel-imap-store.c     |   10 +++++-----
 camel/providers/local/camel-maildir-store.c |    6 +++---
 configure.ac                                |    2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/camel/camel-imapx-store.c b/camel/camel-imapx-store.c
index 6601678..c38d356 100644
--- a/camel/camel-imapx-store.c
+++ b/camel/camel-imapx-store.c
@@ -82,7 +82,7 @@ imapx_name_hash (gconstpointer key)
 		return g_str_hash (key);
 }
 
-static gint
+static gboolean
 imapx_name_equal (gconstpointer a,
                   gconstpointer b)
 {
@@ -1729,7 +1729,7 @@ camel_imapx_store_class_init (CamelIMAPXStoreClass *class)
 
 	store_class = CAMEL_STORE_CLASS (class);
 	store_class->hash_folder_name = imapx_name_hash;
-	store_class->compare_folder_name = imapx_name_equal;
+	store_class->equal_folder_name = imapx_name_equal;
 	store_class->can_refresh_folder = imapx_can_refresh_folder;
 	store_class->free_folder_info = camel_store_free_folder_info_full;
 	store_class->get_folder_sync = imapx_store_get_folder_sync;
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 12fa79d..03eca62 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -286,11 +286,11 @@ store_constructed (GObject *object)
 	class = CAMEL_STORE_GET_CLASS (store);
 
 	g_return_if_fail (class->hash_folder_name != NULL);
-	g_return_if_fail (class->compare_folder_name != NULL);
+	g_return_if_fail (class->equal_folder_name != NULL);
 
 	store->folders = camel_object_bag_new (
 		class->hash_folder_name,
-		class->compare_folder_name,
+		class->equal_folder_name,
 		(CamelCopyFunc) g_strdup, g_free);
 }
 
@@ -1143,7 +1143,7 @@ camel_store_class_init (CamelStoreClass *class)
 	service_class->settings_type = CAMEL_TYPE_STORE_SETTINGS;
 
 	class->hash_folder_name = g_str_hash;
-	class->compare_folder_name = g_str_equal;
+	class->equal_folder_name = g_str_equal;
 	class->can_refresh_folder = store_can_refresh_folder;
 
 	class->get_inbox_folder_sync = store_get_inbox_folder_sync;
diff --git a/camel/camel-store.h b/camel/camel-store.h
index 9263289..449230e 100644
--- a/camel/camel-store.h
+++ b/camel/camel-store.h
@@ -143,7 +143,7 @@ struct _CamelStoreClass {
 	CamelServiceClass parent_class;
 
 	GHashFunc hash_folder_name;
-	GCompareFunc compare_folder_name;
+	GEqualFunc equal_folder_name;
 
 	/* Non-Blocking Methods */
 	gboolean	(*can_refresh_folder)	(CamelStore *store,
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 794939f..3cc8e97 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -71,7 +71,7 @@ static gboolean imap_store_noop_sync (CamelStore *store, GCancellable *cancellab
 static CamelFolder *imap_store_get_junk_folder_sync (CamelStore *store, GCancellable *cancellable, GError **error);
 static CamelFolder *imap_store_get_trash_folder_sync (CamelStore *store, GCancellable *cancellable, GError **error);
 static guint hash_folder_name (gconstpointer key);
-static gint compare_folder_name (gconstpointer a, gconstpointer b);
+static gboolean equal_folder_name (gconstpointer a, gconstpointer b);
 
 static CamelFolderInfo *imap_store_create_folder_sync (CamelStore *store, const gchar *parent_name, const gchar *folder_name, GCancellable *cancellable, GError **error);
 static gboolean imap_store_delete_folder_sync (CamelStore *store, const gchar *folder_name, GCancellable *cancellable, GError **error);
@@ -1502,7 +1502,7 @@ camel_imap_store_class_init (CamelImapStoreClass *class)
 
 	store_class = CAMEL_STORE_CLASS (class);
 	store_class->hash_folder_name = hash_folder_name;
-	store_class->compare_folder_name = compare_folder_name;
+	store_class->equal_folder_name = equal_folder_name;
 	store_class->can_refresh_folder = imap_can_refresh_folder;
 	store_class->free_folder_info = camel_store_free_folder_info_full;
 	store_class->get_folder_sync = imap_store_get_folder_sync;
@@ -1849,9 +1849,9 @@ hash_folder_name (gconstpointer key)
 		return g_str_hash (key);
 }
 
-static gint
-compare_folder_name (gconstpointer a,
-                     gconstpointer b)
+static gboolean
+equal_folder_name (gconstpointer a,
+                   gconstpointer b)
 {
 	gconstpointer aname = a, bname = b;
 
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index ed3f72a..db00da6 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -659,8 +659,8 @@ maildir_store_hash_folder_name (gconstpointer a)
 }
 
 static gboolean
-maildir_store_compare_folder_name (gconstpointer a,
-                                   gconstpointer b)
+maildir_store_equal_folder_name (gconstpointer a,
+                                 gconstpointer b)
 {
 	return g_str_equal (md_canon_name (a), md_canon_name (b));
 }
@@ -818,7 +818,7 @@ camel_maildir_store_class_init (CamelMaildirStoreClass *class)
 
 	store_class = CAMEL_STORE_CLASS (class);
 	store_class->hash_folder_name = maildir_store_hash_folder_name;
-	store_class->compare_folder_name = maildir_store_compare_folder_name;
+	store_class->equal_folder_name = maildir_store_equal_folder_name;
 	store_class->create_folder_sync = maildir_store_create_folder_sync;
 	store_class->free_folder_info = camel_store_free_folder_info_full;
 	store_class->get_folder_sync = maildir_store_get_folder_sync;
diff --git a/configure.ac b/configure.ac
index 2a68525..ee5533e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,7 +112,7 @@ LIBEBOOK_CURRENT=17
 LIBEBOOK_REVISION=1
 LIBEBOOK_AGE=3
 
-LIBCAMEL_CURRENT=38
+LIBCAMEL_CURRENT=39
 LIBCAMEL_REVISION=0
 LIBCAMEL_AGE=0
 



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