diff options
author | Milan Crha <mcrha@redhat.com> | 2012-03-02 18:46:51 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-03-02 18:47:34 +0800 |
commit | 123c91f2412a0937ce1f55c4c7dda96fb0de5f5a (patch) | |
tree | 0d16eac9697452a211a1a03f383e2f0a53dd05cd /plugins/caldav | |
parent | 89f5daa12878d33fecfd059c384a8b8ed6b08826 (diff) | |
download | gsoc2013-evolution-123c91f2412a0937ce1f55c4c7dda96fb0de5f5a.tar gsoc2013-evolution-123c91f2412a0937ce1f55c4c7dda96fb0de5f5a.tar.gz gsoc2013-evolution-123c91f2412a0937ce1f55c4c7dda96fb0de5f5a.tar.bz2 gsoc2013-evolution-123c91f2412a0937ce1f55c4c7dda96fb0de5f5a.tar.lz gsoc2013-evolution-123c91f2412a0937ce1f55c4c7dda96fb0de5f5a.tar.xz gsoc2013-evolution-123c91f2412a0937ce1f55c4c7dda96fb0de5f5a.tar.zst gsoc2013-evolution-123c91f2412a0937ce1f55c4c7dda96fb0de5f5a.zip |
Bug #663745 - Option to create Google Calendar not available
Diffstat (limited to 'plugins/caldav')
-rw-r--r-- | plugins/caldav/Makefile.am | 1 | ||||
-rw-r--r-- | plugins/caldav/caldav-source.c | 27 |
2 files changed, 15 insertions, 13 deletions
diff --git a/plugins/caldav/Makefile.am b/plugins/caldav/Makefile.am index 432cafd08e..437f574850 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 9b318bca2f..b56b4b2c5f 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; |