[evolution-data-server] Remove backward-compatibility cruft for goa-1.0 < 3.8.



commit d9844aa5357214ddbe512bea5584a8f2a0a8028f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Apr 16 13:31:02 2013 -0400

    Remove backward-compatibility cruft for goa-1.0 < 3.8.
    
    In particular, GOA's Google provider uses OAuth 2.0 now, so we can
    drop the OAuth 1.0a support in EGDataGoaAuthorizer and with it the
    last lingering goa-1.0 dependency outside of the GOA module.

 addressbook/backends/google/Makefile.am            |  11 +-
 .../backends/google/e-book-backend-google.c        |  34 --
 .../backends/google/e-gdata-goa-authorizer.c       | 538 ---------------------
 .../backends/google/e-gdata-goa-authorizer.h       |  68 ---
 configure.ac                                       |  10 -
 modules/gnome-online-accounts/Makefile.am          |  45 --
 .../gnome-online-accounts/e-goa-password-based.c   |   6 -
 modules/gnome-online-accounts/goaewsclient.c       |   6 -
 .../module-data-factory-goa.c                      | 295 -----------
 .../module-gnome-online-accounts.c                 |  56 +--
 10 files changed, 19 insertions(+), 1050 deletions(-)
---
diff --git a/addressbook/backends/google/Makefile.am b/addressbook/backends/google/Makefile.am
index 4e52302..6c45d46 100644
--- a/addressbook/backends/google/Makefile.am
+++ b/addressbook/backends/google/Makefile.am
@@ -2,12 +2,6 @@ SUBDIRS = . tests
 
 ebook_backend_LTLIBRARIES = libebookbackendgoogle.la
 
-if HAVE_GOA
-GOA_SOURCES = \
-       e-gdata-goa-authorizer.c \
-       e-gdata-goa-authorizer.h
-endif
-
 libebookbackendgoogle_la_CPPFLAGS = \
        $(AM_CPPFLAGS) \
        -DG_LOG_DOMAIN=\"libebookbackendgoogle\" \
@@ -18,7 +12,6 @@ libebookbackendgoogle_la_CPPFLAGS = \
        $(EVOLUTION_ADDRESSBOOK_CFLAGS) \
        $(SOUP_CFLAGS) \
        $(GDATA_CFLAGS) \
-       $(GOA_CFLAGS) \
        $(CAMEL_CFLAGS) \
        $(CODE_COVERAGE_CFLAGS) \
        $(NULL)
@@ -30,8 +23,7 @@ libebookbackendgoogle_la_SOURCES = \
        e-book-google-utils.c \
        e-book-google-utils.h \
        e-gdata-oauth2-authorizer.c \
-       e-gdata-oauth2-authorizer.h \
-       $(GOA_SOURCES)
+       e-gdata-oauth2-authorizer.h
 
 libebookbackendgoogle_la_LIBADD = \
        $(top_builddir)/addressbook/libebook/libebook-1.2.la \
@@ -42,7 +34,6 @@ libebookbackendgoogle_la_LIBADD = \
        $(EVOLUTION_ADDRESSBOOK_LIBS) \
        $(SOUP_LIBS) \
        $(GDATA_LIBS) \
-       $(GOA_LIBS) \
        $(CAMEL_LIBS)
 
 libebookbackendgoogle_la_LDFLAGS = \
diff --git a/addressbook/backends/google/e-book-backend-google.c 
b/addressbook/backends/google/e-book-backend-google.c
index ca9f2d2..2df1676 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -32,10 +32,6 @@
 #include "e-book-google-utils.h"
 #include "e-gdata-oauth2-authorizer.h"
 
-#ifdef HAVE_GOA
-#include "e-gdata-goa-authorizer.h"
-#endif
-
 #define E_BOOK_BACKEND_GOOGLE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_BOOK_BACKEND_GOOGLE, EBookBackendGooglePrivate))
@@ -371,15 +367,6 @@ backend_is_authorized (EBookBackend *backend)
        if (priv->service == NULL)
                return FALSE;
 
-#ifdef HAVE_GOA
-       /* If we're using OAuth tokens, then as far as the backend
-        * is concerned it's always authorized.  The GDataAuthorizer
-        * will take care of everything in the background without
-        * bothering clients with "auth-required" signals. */
-       if (E_IS_GDATA_GOA_AUTHORIZER (priv->authorizer))
-               return TRUE;
-#endif
-
        return gdata_service_is_authorized (priv->service);
 }
 
@@ -1090,27 +1077,6 @@ request_authorization (EBookBackend *backend,
                g_free (method);
        }
 
-#ifdef HAVE_GOA
-       /* If this is associated with a GNOME Online Account,
-        * use OAuth 1.0a authentication instead of ClientLogin.
-        *
-        * XXX GNOME Online Accounts 3.8 switched its Google provider
-        *     from OAuth 1.0a to OAuth 2.0.  Once we require GOA 3.8
-        *     we can drop this and keep direct GOA usage confined to
-        *     the "gnome-online-accounts" module. */
-       if (priv->authorizer == NULL) {
-               EGDataGoaAuthorizer *authorizer;
-               GoaObject *goa_object;
-
-               goa_object = g_object_get_data (
-                       G_OBJECT (backend), "GNOME Online Account");
-               if (GOA_IS_OBJECT (goa_object)) {
-                       authorizer = e_gdata_goa_authorizer_new (goa_object);
-                       priv->authorizer = GDATA_AUTHORIZER (authorizer);
-               }
-       }
-#endif
-
        if (priv->authorizer == NULL) {
                GDataClientLoginAuthorizer *authorizer;
 
diff --git a/configure.ac b/configure.ac
index c3011dd..e93b322 100644
--- a/configure.ac
+++ b/configure.ac
@@ -468,16 +468,6 @@ if test "x$enable_goa" = xyes; then
 fi
 AM_CONDITIONAL(HAVE_GOA, [test x$enable_goa = xyes])
 
-dnl GoaPasswordBased was introduced in version 3.5.
-if `$PKG_CONFIG --atleast-version=3.5 goa-1.0`; then
-       AC_DEFINE(HAVE_GOA_PASSWORD_BASED,1,[Have GoaPasswordBased in goa-1.0])
-fi
-
-dnl The "imap_smtp" provider was introduced around version 3.7.90.
-if `$PKG_CONFIG --atleast-version=3.7.90 goa-1.0`; then
-       AC_DEFINE(HAVE_GOA_IMAP_SMTP,1,[Have IMAP/SMTP provider in goa-1.0])
-fi
-
 dnl ********************************
 dnl Check for Ubuntu Online Accounts
 dnl ********************************
diff --git a/modules/gnome-online-accounts/Makefile.am b/modules/gnome-online-accounts/Makefile.am
index 4be1ffa..547cc37 100644
--- a/modules/gnome-online-accounts/Makefile.am
+++ b/modules/gnome-online-accounts/Makefile.am
@@ -2,11 +2,6 @@ NULL =
 
 module_LTLIBRARIES = module-gnome-online-accounts.la
 
-# These aren't actually backends, but that's all
-# the installation directory has historically held.
-ecal_backend_LTLIBRARIES = module-data-cal-factory-goa.la
-ebook_backend_LTLIBRARIES = module-data-book-factory-goa.la
-
 module_gnome_online_accounts_la_CPPFLAGS = \
        $(AM_CPPFLAGS) \
        -I$(top_srcdir) \
@@ -39,44 +34,4 @@ module_gnome_online_accounts_la_LDFLAGS = \
        -module -avoid-version $(NO_UNDEFINED) \
        $(NULL)
 
-module_data_factory_goa_CPPFLAGS = \
-       $(AM_CPPFLAGS) \
-       -I$(top_srcdir) \
-       -DG_LOG_DOMAIN=\"module-data-factory-goa\" \
-       $(E_BACKEND_CFLAGS) \
-       $(CAMEL_CFLAGS) \
-       $(SOUP_CFLAGS) \
-       $(GOA_CFLAGS) \
-       $(NULL)
-
-module_data_factory_goa_SOURCES = \
-       module-data-factory-goa.c \
-       $(NULL)
-
-module_data_factory_goa_LIBADD = \
-       $(top_builddir)/libebackend/libebackend-1.2.la \
-       $(top_builddir)/libedataserver/libedataserver-1.2.la \
-       $(E_BACKEND_LIBS) \
-       $(CAMEL_LIBS) \
-       $(SOUP_LIBS) \
-       $(GOA_LIBS) \
-       $(NULL)
-
-module_data_factory_goa_LDFLAGS = \
-       -module -avoid-version $(NO_UNDEFINED) \
-       $(NULL)
-
-# Libtool forces us to build separate modules for the address book
-# and calendar factories, even though the modules are identical.
-
-module_data_cal_factory_goa_la_CPPFLAGS = $(module_data_factory_goa_CPPFLAGS)
-module_data_cal_factory_goa_la_SOURCES = $(module_data_factory_goa_SOURCES)
-module_data_cal_factory_goa_la_LIBADD = $(module_data_factory_goa_LIBADD)
-module_data_cal_factory_goa_la_LDFLAGS = $(module_data_factory_goa_LDFLAGS)
-
-module_data_book_factory_goa_la_CPPFLAGS = $(module_data_factory_goa_CPPFLAGS)
-module_data_book_factory_goa_la_SOURCES = $(module_data_factory_goa_SOURCES)
-module_data_book_factory_goa_la_LIBADD = $(module_data_factory_goa_LIBADD)
-module_data_book_factory_goa_la_LDFLAGS = $(module_data_factory_goa_LDFLAGS)
-
 -include $(top_srcdir)/git.mk
diff --git a/modules/gnome-online-accounts/e-goa-password-based.c 
b/modules/gnome-online-accounts/e-goa-password-based.c
index a7cfc37..759d258 100644
--- a/modules/gnome-online-accounts/e-goa-password-based.c
+++ b/modules/gnome-online-accounts/e-goa-password-based.c
@@ -38,7 +38,6 @@ G_DEFINE_DYNAMIC_TYPE (
        e_goa_password_based,
        E_TYPE_AUTHENTICATION_SESSION)
 
-#ifdef HAVE_GOA_PASSWORD_BASED
 static GoaObject *
 e_goa_password_based_ref_account (ESourceRegistryServer *server,
                                   ESource *source,
@@ -91,14 +90,12 @@ e_goa_password_based_ref_account (ESourceRegistryServer *server,
 
        return match;
 }
-#endif /* HAVE_GOA_PASSWORD_BASED */
 
 static EAuthenticationSessionResult
 e_goa_password_based_execute_sync (EAuthenticationSession *session,
                                    GCancellable *cancellable,
                                    GError **error)
 {
-#ifdef HAVE_GOA_PASSWORD_BASED
        EAuthenticationSessionResult session_result;
        ESourceAuthenticationResult auth_result;
        ESourceAuthenticator *authenticator;
@@ -234,9 +231,6 @@ exit:
        g_free (password);
 
        return session_result;
-#else
-       g_return_val_if_reached (E_AUTHENTICATION_SESSION_ERROR);
-#endif /* HAVE_GOA_PASSWORD_BASED */
 }
 
 static void
diff --git a/modules/gnome-online-accounts/goaewsclient.c b/modules/gnome-online-accounts/goaewsclient.c
index 4fc1ab4..2960b38 100644
--- a/modules/gnome-online-accounts/goaewsclient.c
+++ b/modules/gnome-online-accounts/goaewsclient.c
@@ -53,7 +53,6 @@ typedef struct {
        gchar *username;
 } AutodiscoverAuthData;
 
-#ifdef HAVE_GOA_PASSWORD_BASED
 static void
 ews_autodiscover_data_free (AutodiscoverData *data)
 {
@@ -414,7 +413,6 @@ ews_create_msg_for_url (const gchar *url,
 
        return msg;
 }
-#endif /* HAVE_GOA_PASSWORD_BASED */
 
 void
 goa_ews_autodiscover (GoaObject *goa_object,
@@ -422,9 +420,6 @@ goa_ews_autodiscover (GoaObject *goa_object,
                       GAsyncReadyCallback callback,
                       gpointer user_data)
 {
-       /* XXX This function is only called if HAVE_GOA_PASSWORD_BASED
-        *     is defined, so don't worry about a fallback behavior. */
-#ifdef HAVE_GOA_PASSWORD_BASED
        GoaAccount *goa_account;
        GoaExchange *goa_exchange;
        GoaPasswordBased *goa_password;
@@ -535,7 +530,6 @@ goa_ews_autodiscover (GoaObject *goa_object,
        g_object_unref (goa_account);
        g_object_unref (goa_exchange);
        g_object_unref (goa_password);
-#endif /* HAVE_GOA_PASSWORD_BASED */
 }
 
 gboolean
diff --git a/modules/gnome-online-accounts/module-gnome-online-accounts.c 
b/modules/gnome-online-accounts/module-gnome-online-accounts.c
index e6907f4..c9ad646 100644
--- a/modules/gnome-online-accounts/module-gnome-online-accounts.c
+++ b/modules/gnome-online-accounts/module-gnome-online-accounts.c
@@ -229,7 +229,6 @@ gnome_online_accounts_new_source (EGnomeOnlineAccounts *extension)
        return source;
 }
 
-#ifdef HAVE_GOA_PASSWORD_BASED
 static void
 replace_host (gchar **url,
               const gchar *host)
@@ -247,14 +246,12 @@ replace_host (gchar **url,
 
        soup_uri_free (uri);
 }
-#endif /* HAVE_GOA_PASSWORD_BASED */
 
 static void
 gnome_online_accounts_config_exchange (EGnomeOnlineAccounts *extension,
                                        ESource *source,
                                        GoaObject *goa_object)
 {
-#ifdef HAVE_GOA_PASSWORD_BASED
        GoaExchange *goa_exchange;
        ESourceExtension *source_extension;
        const gchar *extension_name;
@@ -355,7 +352,6 @@ gnome_online_accounts_config_exchange (EGnomeOnlineAccounts *extension,
 
        g_free (as_url);
        g_free (oab_url);
-#endif /* HAVE_GOA_PASSWORD_BASED */
 }
 
 static void
@@ -363,7 +359,6 @@ gnome_online_accounts_config_imap (EGnomeOnlineAccounts *extension,
                                    ESource *source,
                                    GoaObject *goa_object)
 {
-#ifdef HAVE_GOA_IMAP_SMTP
        GoaMail *goa_mail;
        ESourceCamel *camel_extension;
        ESourceBackend *backend_extension;
@@ -438,7 +433,6 @@ gnome_online_accounts_config_imap (EGnomeOnlineAccounts *extension,
                CAMEL_NETWORK_SECURITY_METHOD_NONE);
 
        g_object_unref (network_address);
-#endif
 }
 
 static void
@@ -446,7 +440,6 @@ gnome_online_accounts_config_smtp (EGnomeOnlineAccounts *extension,
                                    ESource *source,
                                    GoaObject *goa_object)
 {
-#ifdef HAVE_GOA_IMAP_SMTP
        GoaMail *goa_mail;
        ESourceCamel *camel_extension;
        ESourceBackend *backend_extension;
@@ -521,7 +514,6 @@ gnome_online_accounts_config_smtp (EGnomeOnlineAccounts *extension,
                CAMEL_NETWORK_SECURITY_METHOD_NONE);
 
        g_object_unref (network_address);
-#endif
 }
 
 static void
@@ -568,14 +560,14 @@ gnome_online_accounts_config_collection (EGnomeOnlineAccounts *extension,
                                          GoaObject *goa_object)
 {
        GoaAccount *goa_account;
+       GoaCalendar *goa_calendar;
+       GoaContacts *goa_contacts;
        ESourceExtension *source_extension;
        const gchar *extension_name;
-       const gchar *provider_type;
-       const gchar *backend_name;
 
        goa_account = goa_object_get_account (goa_object);
-       provider_type = goa_account_get_provider_type (goa_account);
-       backend_name = gnome_online_accounts_get_backend_name (provider_type);
+       goa_calendar = goa_object_get_calendar (goa_object);
+       goa_contacts = goa_object_get_contacts (goa_object);
 
        g_object_bind_property (
                goa_account, "presentation-identity",
@@ -590,30 +582,18 @@ gnome_online_accounts_config_collection (EGnomeOnlineAccounts *extension,
                source_extension, "account-id",
                G_BINDING_SYNC_CREATE);
 
-       /* Requires more properties from ownCloud, but these are not
-        * available before ownCloud was introduced, thus workaround
-        * it with the backend_name check. */
-       if (g_strcmp0 (backend_name, "owncloud") == 0) {
-               GoaCalendar *goa_calendar;
-               GoaContacts *goa_contacts;
-
-               goa_calendar = goa_object_get_calendar (goa_object);
-               if (goa_calendar) {
-                       g_object_bind_property (
-                               goa_calendar, "uri",
-                               source_extension, "calendar-url",
-                               G_BINDING_SYNC_CREATE);
-                       g_object_unref (goa_calendar);
-               }
+       if (goa_calendar != NULL) {
+               g_object_bind_property (
+                       goa_calendar, "uri",
+                       source_extension, "calendar-url",
+                       G_BINDING_SYNC_CREATE);
+       }
 
-               goa_contacts = goa_object_get_contacts (goa_object);
-               if (goa_contacts) {
-                       g_object_bind_property (
-                               goa_contacts, "uri",
-                               source_extension, "contacts-url",
-                               G_BINDING_SYNC_CREATE);
-                       g_object_unref (goa_contacts);
-               }
+       if (goa_contacts != NULL) {
+               g_object_bind_property (
+                       goa_contacts, "uri",
+                       source_extension, "contacts-url",
+                       G_BINDING_SYNC_CREATE);
        }
 
        extension_name = E_SOURCE_EXTENSION_COLLECTION;
@@ -656,7 +636,9 @@ gnome_online_accounts_config_collection (EGnomeOnlineAccounts *extension,
                NULL,
                NULL, (GDestroyNotify) NULL);
 
-       g_object_unref (goa_account);
+       g_clear_object (&goa_account);
+       g_clear_object (&goa_calendar);
+       g_clear_object (&goa_contacts);
 
        /* Handle optional GOA interfaces. */
        gnome_online_accounts_config_exchange (extension, source, goa_object);
@@ -665,14 +647,12 @@ gnome_online_accounts_config_collection (EGnomeOnlineAccounts *extension,
        e_server_side_source_set_removable (
                E_SERVER_SIDE_SOURCE (source), FALSE);
 
-#ifdef HAVE_GOA_PASSWORD_BASED
        if (goa_object_peek_password_based (goa_object) != NULL) {
                /* Obtain passwords from the OnlineAccounts service. */
                e_server_side_source_set_auth_session_type (
                        E_SERVER_SIDE_SOURCE (source),
                        E_TYPE_GOA_PASSWORD_BASED);
        }
-#endif /* HAVE_GOA_PASSWORD_BASED */
 
        if (goa_object_peek_oauth2_based (goa_object) != NULL) {
                /* This module provides OAuth 2.0 support to the collection.


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