Deprecate BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS.
authorMatthew Barnes <mbarnes@redhat.com>
Fri, 16 Nov 2012 19:16:45 +0000 (14:16 -0500)
committerMatthew Barnes <mbarnes@redhat.com>
Fri, 16 Nov 2012 19:35:04 +0000 (14:35 -0500)
This property is not used anywhere.

Remove all references to it from built-in backends.

The following EBook functions now simply return an empty list:

   e_book_get_supported_auth_methods
   e_book_async_get_supported_auth_methods
   e_book_get_supported_auth_methods_async

13 files changed:
addressbook/backends/file/e-book-backend-file.c
addressbook/backends/google/e-book-backend-google.c
addressbook/backends/ldap/e-book-backend-ldap.c
addressbook/backends/vcf/e-book-backend-vcf.c
addressbook/backends/webdav/e-book-backend-webdav.c
addressbook/libebook/e-book-client.c
addressbook/libebook/e-book-client.h
addressbook/libebook/e-book.c
addressbook/libedata-book/e-book-backend.h
docs/reference/addressbook/libebook/libebook-sections.txt
docs/reference/addressbook/libedata-book/libedata-book-sections.txt
libedataserverui/e-client-utils.c
tests/libebook/client/test-client-examine.c

index b3fa627..11f8231 100644 (file)
@@ -1453,8 +1453,6 @@ e_book_backend_file_get_backend_property (EBookBackendSync *backend,
 
                *prop_value = e_data_book_string_slist_to_comma_string (fields);
                g_slist_free (fields);
-       } else if (g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS)) {
-               *prop_value = NULL;
        } else if (g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_REVISION)) {
                *prop_value = g_strdup (bf->priv->revision);
        } else {
index 4cf9245..e8610d3 100644 (file)
@@ -2072,8 +2072,6 @@ e_book_backend_google_get_backend_property (EBookBackend *backend,
 
                g_slist_free (fields);
                g_free (fields_str);
-       } else if (g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS)) {
-               e_data_book_respond_get_backend_property (book, opid, NULL, "plain/password");
        } else {
                E_BOOK_BACKEND_CLASS (e_book_backend_google_parent_class)->get_backend_property (backend, book, opid, cancellable, prop_name);
        }
index 955f964..e746411 100644 (file)
@@ -712,7 +712,6 @@ query_ldap_root_dse (EBookBackendLDAP *bl)
        attrs[i++] = "supportedControl";
        attrs[i++] = "supportedExtension";
        attrs[i++] = "supportedFeatures";
-       attrs[i++] = "supportedSASLMechanisms";
        attrs[i++] = "supportedLDAPVersion";
        attrs[i++] = "subschemaSubentry"; /* OpenLDAP's dn for schema information */
        attrs[i++] = "schemaNamingContext"; /* Active directory's dn for schema information */
@@ -760,32 +759,6 @@ query_ldap_root_dse (EBookBackendLDAP *bl)
        }
 
        g_rec_mutex_lock (&eds_ldap_handler_lock);
-       values = ldap_get_values (bl->priv->ldap, resp, "supportedSASLMechanisms");
-       g_rec_mutex_unlock (&eds_ldap_handler_lock);
-       if (values) {
-               gchar *auth_method;
-               if (bl->priv->supported_auth_methods) {
-                       g_slist_foreach (bl->priv->supported_auth_methods, (GFunc) g_free, NULL);
-                       g_slist_free (bl->priv->supported_auth_methods);
-               }
-               bl->priv->supported_auth_methods = NULL;
-
-               auth_method = g_strdup_printf ("ldap/simple-binddn|%s", _("Using Distinguished Name (DN)"));
-               bl->priv->supported_auth_methods = g_slist_append (bl->priv->supported_auth_methods, auth_method);
-
-               auth_method = g_strdup_printf ("ldap/simple-email|%s", _("Using Email Address"));
-               bl->priv->supported_auth_methods = g_slist_append (bl->priv->supported_auth_methods, auth_method);
-
-               for (i = 0; values[i]; i++) {
-                       auth_method = g_strdup_printf ("sasl/%s|%s", values[i], values[i]);
-                       bl->priv->supported_auth_methods = g_slist_append (bl->priv->supported_auth_methods, auth_method);
-                       if (enable_debug)
-                               g_message ("supported SASL mechanism: %s", values[i]);
-               }
-               ldap_value_free (values);
-       }
-
-       g_rec_mutex_lock (&eds_ldap_handler_lock);
        values = ldap_get_values (bl->priv->ldap, resp, "subschemaSubentry");
        g_rec_mutex_unlock (&eds_ldap_handler_lock);
        if (!values || !values[0]) {
@@ -5366,15 +5339,6 @@ e_book_backend_ldap_get_backend_property (EBookBackend *backend,
                e_data_book_respond_get_backend_property (book, opid, NULL, str);
 
                g_free (str);
-       } else if (g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS)) {
-               EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
-               gchar *str;
-
-               str = e_data_book_string_slist_to_comma_string (bl->priv->supported_auth_methods);
-
-               e_data_book_respond_get_backend_property (book, opid, NULL, str);
-
-               g_free (str);
        } else {
                E_BOOK_BACKEND_CLASS (e_book_backend_ldap_parent_class)->get_backend_property (backend, book, opid, cancellable, prop_name);
        }
index 2774ac3..41c0bdb 100644 (file)
@@ -702,8 +702,6 @@ e_book_backend_vcf_get_backend_property (EBookBackendSync *backend,
 
                *prop_value = e_data_book_string_slist_to_comma_string (fields);
                g_slist_free (fields);
-       } else if (g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS)) {
-               *prop_value = NULL;
        } else {
                processed = FALSE;
        }
index 107755e..e414eb4 100644 (file)
@@ -1404,8 +1404,6 @@ e_book_backend_webdav_get_backend_property (EBookBackend *backend,
 
                g_slist_free (fields);
                g_free (fields_str);
-       } else if (g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS)) {
-               e_data_book_respond_get_backend_property (book, opid, NULL, "plain/password");
        } else {
                E_BOOK_BACKEND_CLASS (e_book_backend_webdav_parent_class)->get_backend_property (backend, book, opid, cancellable, prop_name);
        }
index 32e0627..acc6cba 100644 (file)
@@ -59,10 +59,6 @@ G_DEFINE_TYPE (EBookClient, e_book_client, E_TYPE_CLIENT)
  *   of supported fields by the backend. Use e_client_util_parse_comma_strings()
  *   to parse returned string value into a #GSList. These fields can be
  *   stored for contacts.
- * @BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS: Retrieves comma-separated list
- *   of supported authentication methods by the backend.
- *   Use e_client_util_parse_comma_strings() to parse returned string value
- *   into a #GSList.
  *
  * See also: @CLIENT_BACKEND_PROPERTY_OPENED, @CLIENT_BACKEND_PROPERTY_OPENING,
  *   @CLIENT_BACKEND_PROPERTY_ONLINE, @CLIENT_BACKEND_PROPERTY_READONLY
index c340849..26da1d6 100644 (file)
 #define BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS         "supported-fields"
 
 /**
- * BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS:
- *
- * FIXME: Document me.
- *
- * Since: 3.2
- **/
-#define BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS   "supported-auth-methods"
-
-/**
  * E_BOOK_CLIENT_ERROR:
  *
  * FIXME: Document me.
@@ -302,6 +293,17 @@ gboolean   e_book_client_get_view_sync     (EBookClient *client,
                                                 GCancellable *cancellable,
                                                 GError **error);
 
+#ifndef EDS_DISABLE_DEPRECATED
+/**
+ * BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS:
+ *
+ * Since: 3.2
+ *
+ * Deprecated: 3.8: The property is no longer supported.
+ **/
+#define BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS   "supported-auth-methods"
+#endif /* EDS_DISABLE_DEPRECATED */
+
 G_END_DECLS
 
 #endif /* E_BOOK_CLIENT_H */
index 3e9fd99..28c9bbe 100644 (file)
@@ -52,7 +52,6 @@
 #define CLIENT_BACKEND_PROPERTY_CAPABILITIES           "capabilities"
 #define BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS          "required-fields"
 #define BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS         "supported-fields"
-#define BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS   "supported-auth-methods"
 
 struct _EBookPrivate {
        EBookClient *client;
@@ -959,100 +958,19 @@ e_book_get_supported_fields_async (EBook *book,
  *
  * Returns: %TRUE if successful, %FALSE otherwise
  *
- * Deprecated: 3.2: Use e_client_get_backend_property_sync() on
- * an #EBookClient object with #BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS instead.
+ * Deprecated: 3.2: The property is no longer supported.
  **/
 gboolean
 e_book_get_supported_auth_methods (EBook *book,
                                    GList **auth_methods,
                                    GError **error)
 {
-       gchar *prop_value = NULL;
-       gboolean success;
-
        g_return_val_if_fail (E_IS_BOOK (book), FALSE);
 
        if (auth_methods != NULL)
                *auth_methods = NULL;
 
-       success = e_client_get_backend_property_sync (
-               E_CLIENT (book->priv->client),
-               BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS,
-               &prop_value, NULL, error);
-
-       if (success && auth_methods != NULL) {
-               GQueue queue = G_QUEUE_INIT;
-               gchar **strv;
-               gint ii;
-
-               strv = g_strsplit (prop_value, ",", -1);
-
-               for (ii = 0; strv != NULL && strv[ii] != NULL; ii++)
-                       g_queue_push_tail (&queue, strv[ii]);
-
-               /* The GQueue now owns the strings in the string array,
-                * so use g_free() instead of g_strfreev() to free just
-                * the array itself. */
-               g_free (strv);
-
-               /* Transfer ownership of the GQueue content. */
-               *auth_methods = g_queue_peek_head_link (&queue);
-       }
-
-       g_free (prop_value);
-
-       return success;
-}
-
-static void
-get_supported_auth_methods_reply (GObject *source_object,
-                                  GAsyncResult *result,
-                                  gpointer user_data)
-{
-       AsyncData *data = user_data;
-       EBookEListCallback cb = data->callback;
-       EBookEListAsyncCallback excb = data->excallback;
-       EList *elist;
-       gchar *prop_value = NULL;
-       GError *error = NULL;
-
-       e_client_get_backend_property_finish (
-               E_CLIENT (source_object), result, &prop_value, &error);
-
-       /* Sanity check. */
-       g_return_if_fail (
-               ((prop_value != NULL) && (error == NULL)) ||
-               ((prop_value == NULL) && (error != NULL)));
-
-       /* In the event of an error, we pass an empty EList. */
-       elist = e_list_new (NULL, (EListFreeFunc) g_free, NULL);
-
-       if (prop_value != NULL) {
-               gchar **strv;
-               gint ii;
-
-               strv = g_strsplit (prop_value, ",", -1);
-               for (ii = 0; strv != NULL && strv[ii] != NULL; ii++) {
-                       gchar *utf8 = e_util_utf8_make_valid (strv[ii]);
-                       e_list_append (elist, utf8);
-               }
-               g_strfreev (strv);
-       }
-
-       if (cb != NULL && error == NULL)
-               cb (data->book, E_BOOK_ERROR_OK, elist, data->closure);
-       if (cb != NULL && error != NULL)
-               cb (data->book, error->code, elist, data->closure);
-       if (excb != NULL)
-               excb (data->book, error, elist, data->closure);
-
-       g_object_unref (elist);
-
-       if (error != NULL)
-               g_error_free (error);
-
-       g_object_unref (data->book);
-       g_slice_free (AsyncData, data);
+       return TRUE;
 }
 
 /**
@@ -1066,26 +984,21 @@ get_supported_auth_methods_reply (GObject *source_object,
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
  *
- * Deprecated: 3.0: Use e_book_get_supported_auth_methods_async() instead.
+ * Deprecated: 3.0: The property is no longer supported.
  **/
 gboolean
 e_book_async_get_supported_auth_methods (EBook *book,
                                          EBookEListCallback cb,
                                          gpointer closure)
 {
-       AsyncData *data;
-
        g_return_val_if_fail (E_IS_BOOK (book), FALSE);
 
-       data = g_slice_new0 (AsyncData);
-       data->book = g_object_ref (book);
-       data->callback = cb;
-       data->closure = closure;
-
-       e_client_get_backend_property (
-               E_CLIENT (book->priv->client),
-               BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS,
-               NULL, get_supported_auth_methods_reply, data);
+       if (cb != NULL) {
+               /* Pass the callback an empty list. */
+               EList *elist = e_list_new (NULL, NULL, NULL);
+               cb (book, E_BOOK_ERROR_OK, elist, closure);
+               g_object_unref (elist);
+       }
 
        return TRUE;
 }
@@ -1103,27 +1016,21 @@ e_book_async_get_supported_auth_methods (EBook *book,
  *
  * Since: 2.32
  *
- * Deprecated: 3.2: Use e_client_get_backend_property() and e_client_get_backend_property_finish()
- * on an #EBookClient object with #BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS instead.
+ * Deprecated: 3.2: The property is no longer supported.
  **/
 gboolean
 e_book_get_supported_auth_methods_async (EBook *book,
                                          EBookEListAsyncCallback cb,
                                          gpointer closure)
 {
-       AsyncData *data;
-
        g_return_val_if_fail (E_IS_BOOK (book), FALSE);
 
-       data = g_slice_new0 (AsyncData);
-       data->book = g_object_ref (book);
-       data->excallback = cb;
-       data->closure = closure;
-
-       e_client_get_backend_property (
-               E_CLIENT (book->priv->client),
-               BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS,
-               NULL, get_supported_auth_methods_reply, data);
+       if (cb != NULL) {
+               /* Pass the callback an empty list. */
+               EList *elist = e_list_new (NULL, NULL, NULL);
+               cb (book, NULL, elist, closure);
+               g_object_unref (elist);
+       }
 
        return TRUE;
 }
index 520e0fb..cafa765 100644 (file)
 #define BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS         "supported-fields"
 
 /**
- * BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS:
- *
- * FIXME: Document me.
- *
- * Since: 3.2
- **/
-#define BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS   "supported-auth-methods"
-
-/**
  * BOOK_BACKEND_PROPERTY_REVISION:
  *
  * The current overall revision string, this can be used as
@@ -338,6 +329,15 @@ void               e_book_backend_respond_opened   (EBookBackend *backend,
                                                 GError *error);
 
 #ifndef EDS_DISABLE_DEPRECATED
+/**
+ * BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS:
+ *
+ * Since: 3.2
+ *
+ * Deprecated: 3.8: The property is no longer supported.
+ **/
+#define BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS   "supported-auth-methods"
+
 void           e_book_backend_foreach_view     (EBookBackend *backend,
                                                 gboolean (*callback) (EDataBookView *view,
                                                                       gpointer user_data),
index 40c2b06..d0a223f 100644 (file)
@@ -113,7 +113,6 @@ EBookPrivate
 <TITLE>EBookClient</TITLE>
 BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS
 BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS
-BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS
 E_BOOK_CLIENT_ERROR
 EBookClientError
 e_book_client_error_to_string
@@ -156,6 +155,7 @@ e_book_client_get_contacts_uids_sync
 e_book_client_get_view
 e_book_client_get_view_finish
 e_book_client_get_view_sync
+BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS
 <SUBSECTION Standard>
 E_BOOK_CLIENT
 E_IS_BOOK_CLIENT
index c018586..8f23cca 100644 (file)
@@ -10,7 +10,6 @@ CLIENT_BACKEND_PROPERTY_CACHE_DIR
 CLIENT_BACKEND_PROPERTY_CAPABILITIES
 BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS
 BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS
-BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS
 BOOK_BACKEND_PROPERTY_REVISION
 e_book_backend_get_cache_dir
 e_book_backend_set_cache_dir
@@ -47,6 +46,7 @@ e_book_backend_notify_property_changed
 e_book_backend_sync
 e_book_backend_set_is_removed
 e_book_backend_respond_opened
+BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS
 e_book_backend_foreach_view
 <SUBSECTION Standard>
 E_BOOK_BACKEND
index 3c822be..f41888b 100644 (file)
@@ -227,7 +227,6 @@ client_utils_capabilities_retrieved_cb (GObject *source_object,
 
                        e_client_get_backend_property (async_data->client, BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS, async_data->cancellable, client_utils_get_backend_property_cb, async_data);
                        e_client_get_backend_property (async_data->client, BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS, async_data->cancellable, client_utils_get_backend_property_cb, async_data);
-                       e_client_get_backend_property (async_data->client, BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS, async_data->cancellable, client_utils_get_backend_property_cb, async_data);
                } else {
                        g_warn_if_reached ();
                        client_utils_get_backend_property_cb (source_object, NULL, async_data);
index fbc1c3b..0dc7d48 100644 (file)
@@ -21,7 +21,6 @@ get_known_prop_names (void)
        prop_names = g_slist_append (prop_names, (gpointer) CLIENT_BACKEND_PROPERTY_CAPABILITIES);
        prop_names = g_slist_append (prop_names, (gpointer) BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS);
        prop_names = g_slist_append (prop_names, (gpointer) BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS);
-       prop_names = g_slist_append (prop_names, (gpointer) BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS);
 
        return prop_names;
 }
@@ -60,8 +59,7 @@ print_each_property (gpointer prop_name,
 
        if (g_str_equal (prop_name, CLIENT_BACKEND_PROPERTY_CAPABILITIES) ||
            g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS) ||
-           g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS) ||
-           g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS)) {
+           g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS)) {
                GSList *values = e_client_util_parse_comma_strings (prop_value), *v;
 
                for (v = values; v; v = v->next) {