[evolution] Bug #663745 - Option to create Google Calendar not available



commit 123c91f2412a0937ce1f55c4c7dda96fb0de5f5a
Author: Milan Crha <mcrha redhat com>
Date:   Fri Mar 2 11:46:51 2012 +0100

    Bug #663745 - Option to create Google Calendar not available

 plugins/caldav/Makefile.am                         |    1 +
 plugins/caldav/caldav-source.c                     |   27 ++++++++++---------
 plugins/google-account-setup/Makefile.am           |    1 +
 .../google-account-setup/google-contacts-source.c  |   16 ++++++------
 plugins/google-account-setup/google-source.c       |   27 ++++++++-----------
 plugins/webdav-account-setup/Makefile.am           |    1 +
 .../webdav-account-setup/webdav-contacts-source.c  |   13 +++++----
 7 files changed, 43 insertions(+), 43 deletions(-)
---
diff --git a/plugins/caldav/Makefile.am b/plugins/caldav/Makefile.am
index 432cafd..437f574 100644
--- a/plugins/caldav/Makefile.am
+++ b/plugins/caldav/Makefile.am
@@ -18,6 +18,7 @@ liborg_gnome_evolution_caldav_la_SOURCES =		\
 
 liborg_gnome_evolution_caldav_la_LIBADD = 		\
 	$(top_builddir)/e-util/libeutil.la		\
+	$(top_builddir)/shell/libeshell.la		\
 	$(top_builddir)/widgets/misc/libemiscwidgets.la	\
 	$(top_builddir)/libemail-utils/libemail-utils.la  \
 	$(EVOLUTION_DATA_SERVER_LIBS)			\
diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c
index 9b318bc..b56b4b2 100644
--- a/plugins/caldav/caldav-source.c
+++ b/plugins/caldav/caldav-source.c
@@ -31,6 +31,7 @@
 #include <e-util/e-config.h>
 #include <e-util/e-plugin.h>
 #include <e-util/e-plugin-util.h>
+#include <shell/e-shell.h>
 #include <calendar/gui/e-cal-config.h>
 #include <libedataserver/e-account-list.h>
 #include <libecal/e-cal-client.h>
@@ -53,19 +54,19 @@ GtkWidget *      oge_caldav               (EPlugin                    *epl,
 /* plugin intialization */
 
 static void
-ensure_caldav_source_group (ECalClientSourceType source_type)
+ensure_caldav_source_group (const gchar *backend_name)
 {
-	ESourceList *slist;
-	GError *error = NULL;
+	EShellBackend *backend;
+	ESourceList *source_list = NULL;
 
-	if (!e_cal_client_get_sources (&slist, source_type, &error)) {
-		g_warning ("Could not get calendar sources: %s", error->message);
-		g_error_free (error);
-		return;
-	}
+	backend = e_shell_get_backend_by_name (e_shell_get_default (), backend_name);
+	g_return_if_fail (backend != NULL);
+
+	g_object_get (G_OBJECT (backend), "source-list", &source_list, NULL);
+	g_return_if_fail (source_list != NULL);
 
-	e_source_list_ensure_group (slist, _("CalDAV"), "caldav://", FALSE);
-	g_object_unref (slist);
+	e_source_list_ensure_group (source_list, _("CalDAV"), "caldav://", FALSE);
+	g_object_unref (source_list);
 }
 
 gint
@@ -75,9 +76,9 @@ e_plugin_lib_enable (EPlugin *ep,
 
 	if (enable) {
 		d(g_print ("CalDAV Eplugin starting up ...\n"));
-		ensure_caldav_source_group (E_CAL_CLIENT_SOURCE_TYPE_EVENTS);
-		ensure_caldav_source_group (E_CAL_CLIENT_SOURCE_TYPE_TASKS);
-		ensure_caldav_source_group (E_CAL_CLIENT_SOURCE_TYPE_MEMOS);
+		ensure_caldav_source_group ("calendar");
+		ensure_caldav_source_group ("tasks");
+		ensure_caldav_source_group ("memos");
 	}
 
 	return 0;
diff --git a/plugins/google-account-setup/Makefile.am b/plugins/google-account-setup/Makefile.am
index 7380912..9842673 100644
--- a/plugins/google-account-setup/Makefile.am
+++ b/plugins/google-account-setup/Makefile.am
@@ -22,6 +22,7 @@ liborg_gnome_evolution_google_la_SOURCES =        \
 liborg_gnome_evolution_google_la_LIBADD = 			\
 	$(top_builddir)/calendar/gui/libevolution-calendar.la	\
 	$(top_builddir)/e-util/libeutil.la			\
+	$(top_builddir)/shell/libeshell.la			\
 	$(EVOLUTION_DATA_SERVER_LIBS)				\
 	$(GNOME_PLATFORM_LIBS)					\
 	$(GDATA_LIBS)
diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c
index 5653881..9345deb 100644
--- a/plugins/google-account-setup/google-contacts-source.c
+++ b/plugins/google-account-setup/google-contacts-source.c
@@ -30,6 +30,7 @@
 
 #include <e-util/e-config.h>
 #include <e-util/e-plugin.h>
+#include <shell/e-shell.h>
 #include <addressbook/gui/widgets/eab-config.h>
 
 #include <libedataserver/e-source.h>
@@ -42,17 +43,16 @@
 void
 ensure_google_contacts_source_group (void)
 {
-	ESourceList  *source_list;
-	const gchar *key;
+	EShellBackend *backend;
+	ESourceList *source_list = NULL;
 
-	key = "/apps/evolution/addressbook/sources";
-	source_list = e_source_list_new_for_gconf_default (key);
+	backend = e_shell_get_backend_by_name (e_shell_get_default (), "contacts");
+	g_return_if_fail (backend != NULL);
 
-	if (source_list == NULL)
-		return;
+	g_object_get (G_OBJECT (backend), "source-list", &source_list, NULL);
+	g_return_if_fail (source_list != NULL);
 
-	e_source_list_ensure_group (
-		source_list, _("Google"), "google://", FALSE);
+	e_source_list_ensure_group (source_list, _("Google"), "google://", FALSE);
 	g_object_unref (source_list);
 }
 
diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c
index 76dd8ae..b6dde02 100644
--- a/plugins/google-account-setup/google-source.c
+++ b/plugins/google-account-setup/google-source.c
@@ -35,6 +35,7 @@
 #include <e-util/e-config.h>
 #include <e-util/e-plugin.h>
 #include <e-util/e-plugin-util.h>
+#include <shell/e-shell.h>
 
 #include <calendar/gui/e-cal-config.h>
 #include <calendar/gui/e-cal-event.h>
@@ -70,29 +71,23 @@ void e_calendar_google_migrate (EPlugin *epl, ECalEventTargetBackend *data);
 static void
 ensure_google_source_group (void)
 {
-	ESourceList  *slist;
-	GError *error = NULL;
+	EShellBackend *backend;
+	ESourceList *source_list = NULL;
 
-	e_cal_client_get_sources (
-		&slist, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, &error);
+	backend = e_shell_get_backend_by_name (e_shell_get_default (), "calendar");
+	g_return_if_fail (backend != NULL);
 
-	if (error != NULL) {
-		g_warning (
-			"%s: Could not get calendar source list: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
-		return;
-	}
+	g_object_get (G_OBJECT (backend), "source-list", &source_list, NULL);
+	g_return_if_fail (source_list != NULL);
 
-	e_source_list_ensure_group (slist, _("Google"), GOOGLE_BASE_URI, FALSE);
-	g_object_unref (slist);
+	e_source_list_ensure_group (source_list, _("Google"), GOOGLE_BASE_URI, FALSE);
+	g_object_unref (source_list);
 }
 
 gint
 e_plugin_lib_enable (EPlugin *ep,
                      gint enable)
 {
-
 	if (enable) {
 		d(printf ("\n Google Eplugin starting up ...\n"));
 		ensure_google_source_group ();
diff --git a/plugins/webdav-account-setup/Makefile.am b/plugins/webdav-account-setup/Makefile.am
index d4d9d00..58c9b91 100644
--- a/plugins/webdav-account-setup/Makefile.am
+++ b/plugins/webdav-account-setup/Makefile.am
@@ -16,6 +16,7 @@ liborg_gnome_evolution_webdav_la_SOURCES = \
 
 liborg_gnome_evolution_webdav_la_LIBADD =	\
 	$(top_builddir)/e-util/libeutil.la	\
+	$(top_builddir)/shell/libeshell.la	\
 	$(EVOLUTION_DATA_SERVER_LIBS)		\
 	$(GNOME_PLATFORM_LIBS)
 
diff --git a/plugins/webdav-account-setup/webdav-contacts-source.c b/plugins/webdav-account-setup/webdav-contacts-source.c
index b611852..f81abe3 100644
--- a/plugins/webdav-account-setup/webdav-contacts-source.c
+++ b/plugins/webdav-account-setup/webdav-contacts-source.c
@@ -31,6 +31,7 @@
 #include <e-util/e-config.h>
 #include <e-util/e-plugin.h>
 #include <e-util/e-plugin-util.h>
+#include <shell/e-shell.h>
 #include <addressbook/gui/widgets/eab-config.h>
 
 #include <libedataserver/e-source.h>
@@ -57,14 +58,14 @@ e_plugin_lib_enable (EPlugin *ep,
 static void
 ensure_webdav_contacts_source_group (void)
 {
-	ESourceList  *source_list;
+	EShellBackend *backend;
+	ESourceList *source_list = NULL;
 
-	source_list = e_source_list_new_for_gconf_default (
-		"/apps/evolution/addressbook/sources");
+	backend = e_shell_get_backend_by_name (e_shell_get_default (), "contacts");
+	g_return_if_fail (backend != NULL);
 
-	if (source_list == NULL) {
-		return;
-	}
+	g_object_get (G_OBJECT (backend), "source-list", &source_list, NULL);
+	g_return_if_fail (source_list != NULL);
 
 	e_source_list_ensure_group (source_list, _("WebDAV"), BASE_URI, FALSE);
 	g_object_unref (source_list);



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