aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2011-06-14 15:21:27 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:27 +0800
commit5f92f064e670b784dbc78d789e85e21fb83d3559 (patch)
tree090d75e36d6197edb96bc6712a3161ad1e0dc4f3
parent84339b3be5a771406fcd5898bbd21dc1c5b98c82 (diff)
downloadgsoc2013-evolution-5f92f064e670b784dbc78d789e85e21fb83d3559.tar
gsoc2013-evolution-5f92f064e670b784dbc78d789e85e21fb83d3559.tar.gz
gsoc2013-evolution-5f92f064e670b784dbc78d789e85e21fb83d3559.tar.bz2
gsoc2013-evolution-5f92f064e670b784dbc78d789e85e21fb83d3559.tar.lz
gsoc2013-evolution-5f92f064e670b784dbc78d789e85e21fb83d3559.tar.xz
gsoc2013-evolution-5f92f064e670b784dbc78d789e85e21fb83d3559.tar.zst
gsoc2013-evolution-5f92f064e670b784dbc78d789e85e21fb83d3559.zip
Bug #652394 - Port google-account-setup plugin to libgdata 0.9.0
-rw-r--r--configure.ac6
-rw-r--r--plugins/google-account-setup/google-source.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 1078197d2a..903e50e7be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1283,10 +1283,14 @@ EVO_SET_COMPILE_FLAGS(LIBSOUP, libsoup-gnome-2.4 >= libsoup_minimum_version)
AC_SUBST(LIBSOUP_CFLAGS)
AC_SUBST(LIBSOUP_LIBS)
-EVO_SET_COMPILE_FLAGS(GDATA, libgdata >= 0.4.0)
+EVO_SET_COMPILE_FLAGS(GDATA, libgdata >= 0.7.0)
AC_SUBST(GDATA_CFLAGS)
AC_SUBST(GDATA_LIBS)
+if `$PKG_CONFIG --atleast-version=0.9 libgdata`; then
+ AC_DEFINE(HAVE_LIBGDATA_0_9,1,[libgdata is 0.9 or higher])
+fi
+
EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, libgtkhtml-4.0 libebook-1.2 libecal-1.2 libedataserverui-3.0 libebackend-1.2 $libnotify gtkhtml-editor-4.0)
AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
AC_SUBST(EVOLUTION_CALENDAR_LIBS)
diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c
index 1fce9858b8..1e54362c0d 100644
--- a/plugins/google-account-setup/google-source.c
+++ b/plugins/google-account-setup/google-source.c
@@ -418,6 +418,9 @@ static void
retrieve_list_clicked (GtkButton *button, GtkComboBox *combo)
{
ESource *source;
+ #ifdef HAVE_LIBGDATA_0_9
+ GDataClientLoginAuthorizer *authorizer;
+ #endif
GDataCalendarService *service;
GDataFeed *feed;
gchar *user, *password, *tmp;
@@ -448,8 +451,14 @@ retrieve_list_clicked (GtkButton *button, GtkComboBox *combo)
return;
}
+ #ifdef HAVE_LIBGDATA_0_9
+ authorizer = gdata_client_login_authorizer_new ("evolution-client-0.1.0", GDATA_TYPE_CALENDAR_SERVICE);
+ service = gdata_calendar_service_new (GDATA_AUTHORIZER (authorizer));
+ if (!gdata_client_login_authorizer_authenticate (authorizer, user, password, NULL, &error)) {
+ #else
service = gdata_calendar_service_new ("evolution-client-0.1.0");
if (!gdata_service_authenticate (GDATA_SERVICE (service), user, password, NULL, &error)) {
+ #endif
/* Error! */
claim_error (parent, error->message);
g_error_free (error);
@@ -559,6 +568,9 @@ retrieve_list_clicked (GtkButton *button, GtkComboBox *combo)
}
g_object_unref (service);
+ #ifdef HAVE_LIBGDATA_0_9
+ g_object_unref (authorizer);
+ #endif
g_free (user);
}