diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2003-12-22 23:57:30 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2003-12-22 23:57:30 +0800 |
commit | f3aed51eeb6e6ef1eaadbc3559d2a38c996ed7da (patch) | |
tree | d59fdcd68d5a9f2a6d1d1ccecf0f3784597b9e32 /calendar | |
parent | 0dfb205f6ae400c996093098102e089f6140a09e (diff) | |
download | gsoc2013-evolution-f3aed51eeb6e6ef1eaadbc3559d2a38c996ed7da.tar.gz gsoc2013-evolution-f3aed51eeb6e6ef1eaadbc3559d2a38c996ed7da.tar.zst gsoc2013-evolution-f3aed51eeb6e6ef1eaadbc3559d2a38c996ed7da.zip |
new files for managing interactive authentication with backends.
2003-12-22 Rodrigo Moya <rodrigo@ximian.com>
* common/authentication.[ch]: new files for managing interactive
authentication with backends.
* common/Makefile.am: build new private library.
* gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar):
* gui/dialogs/event-page.c (source_changed_cb):
* gui/dialogs/task-page.c (source_changed_cb):
* gui/dialogs/copy-source-dialog.c (copy_source):
* gui/calendar-component.c (setup_create_ecal):
* gui/calendar-offline-handler.c (backend_go_offline,
backend_go_online, calendar_offline_handler_init):
* gui/comp-editor-factory.c (open_client):
* gui/e-itip-control.c (start_calendar_server):
* gui/e-tasks.c (e_tasks_add_todo_uri):
* gui/gnome-cal.c (gnome_calendar_construct,
gnome_calendar_add_event_uri):
* gui/tasks-component.c (setup_create_ecal):
* importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn,
gnome_calendar_import_data_fn): create the ECal's via the
auth_new_cal_from* functions in the authentication module.
* gui/alarm-notify/Makefile.am:
* gui/Makefile.am:
* importers/Makefile.am: link new private library.
* Makefile.am: added new directory to the build.
svn path=/trunk/; revision=23999
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 30 | ||||
-rw-r--r-- | calendar/Makefile.am | 2 | ||||
-rw-r--r-- | calendar/common/Makefile.am | 28 | ||||
-rw-r--r-- | calendar/common/authentication.c | 73 | ||||
-rw-r--r-- | calendar/common/authentication.h | 33 | ||||
-rw-r--r-- | calendar/gui/Makefile.am | 1 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/Makefile.am | 2 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/alarm-notify.c | 3 | ||||
-rw-r--r-- | calendar/gui/calendar-component.c | 5 | ||||
-rw-r--r-- | calendar/gui/calendar-offline-handler.c | 7 | ||||
-rw-r--r-- | calendar/gui/comp-editor-factory.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/copy-source-dialog.c | 5 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-day-view.h | 8 | ||||
-rw-r--r-- | calendar/gui/e-itip-control.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-tasks.c | 4 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 5 | ||||
-rw-r--r-- | calendar/gui/tasks-component.c | 5 | ||||
-rw-r--r-- | calendar/importers/Makefile.am | 5 | ||||
-rw-r--r-- | calendar/importers/icalendar-importer.c | 13 |
21 files changed, 208 insertions, 33 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 8a73990617..d26b6ddfba 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,33 @@ +2003-12-22 Rodrigo Moya <rodrigo@ximian.com> + + * common/authentication.[ch]: new files for managing interactive + authentication with backends. + + * common/Makefile.am: build new private library. + + * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar): + * gui/dialogs/event-page.c (source_changed_cb): + * gui/dialogs/task-page.c (source_changed_cb): + * gui/dialogs/copy-source-dialog.c (copy_source): + * gui/calendar-component.c (setup_create_ecal): + * gui/calendar-offline-handler.c (backend_go_offline, + backend_go_online, calendar_offline_handler_init): + * gui/comp-editor-factory.c (open_client): + * gui/e-itip-control.c (start_calendar_server): + * gui/e-tasks.c (e_tasks_add_todo_uri): + * gui/gnome-cal.c (gnome_calendar_construct, + gnome_calendar_add_event_uri): + * gui/tasks-component.c (setup_create_ecal): + * importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn, + gnome_calendar_import_data_fn): create the ECal's via the + auth_new_cal_from* functions in the authentication module. + + * gui/alarm-notify/Makefile.am: + * gui/Makefile.am: + * importers/Makefile.am: link new private library. + + * Makefile.am: added new directory to the build. + 2003-12-21 JP Rosevear <jpr@ximian.com> * gui/e-itip-control.[hc]: rewrite for new ecal api, cache all diff --git a/calendar/Makefile.am b/calendar/Makefile.am index 76851cc008..9e74d29e99 100644 --- a/calendar/Makefile.am +++ b/calendar/Makefile.am @@ -4,7 +4,7 @@ else CONDUIT_DIR = endif -SUBDIRS = idl gui importers $(CONDUIT_DIR) +SUBDIRS = idl common gui importers $(CONDUIT_DIR) EXTRA_DIST = \ ChangeLog.pre-1-4 \ diff --git a/calendar/common/Makefile.am b/calendar/common/Makefile.am new file mode 100644 index 0000000000..8b0dbdb9e5 --- /dev/null +++ b/calendar/common/Makefile.am @@ -0,0 +1,28 @@ +noinst_LTLIBRARIES = libevolution-calendarprivate.la + +INCLUDES = \ + -DG_LOG_DOMAIN=\"calendar-gui\" \ + -I$(top_builddir)/shell \ + -I$(top_srcdir)/shell \ + -I$(top_srcdir) \ + -I$(top_srcdir)/calendar \ + -I$(top_srcdir)/widgets \ + -I$(top_srcdir)/a11y/calendar \ + -DEVOLUTION_DATADIR=\""$(datadir)"\" \ + -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ + -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ + -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ + -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \ + -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \ + -DPREFIX=\""$(prefix)"\" \ + $(EVOLUTION_CALENDAR_CFLAGS) + +libevolution_calendarprivate_la_SOURCES = \ + authentication.c \ + authentication.h + +libevolution_calendarprivate_la_LIBADD = \ + $(top_builddir)/e-util/libeutil.la \ + $(EVOLUTION_CALENDAR_LIBS) + +libevolution_calendarprivate_la_LDFLAGS = -avoid-version -module diff --git a/calendar/common/authentication.c b/calendar/common/authentication.c new file mode 100644 index 0000000000..849a2e76c3 --- /dev/null +++ b/calendar/common/authentication.c @@ -0,0 +1,73 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * Authors : + * Rodrigo Moya <rodrigo@ximian.com> + * + * Copyright 2003, Novell, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +#include <string.h> +#include <bonobo/bonobo-i18n.h> +#include "e-util/e-passwords.h" +#include "authentication.h" + +static char * +auth_func_cb (ECal *ecal, const char *prompt, const char *key, gpointer user_data) +{ + gboolean remember; + + return e_passwords_ask_password (_("Enter password"), "Calendar", key, prompt, TRUE, + E_PASSWORDS_REMEMBER_FOREVER, &remember, + NULL); +} + +ECal * +auth_new_cal_from_source (ESource *source, ECalSourceType type) +{ + ECal *cal; + + cal = e_cal_new (source, type); + e_cal_set_auth_func (cal, (ECalAuthFunc) auth_func_cb, NULL); + + return cal; +} + +ECal * +auth_new_cal_from_uri (const char *uri, ECalSourceType type) +{ + ESourceGroup *group; + ESource *source; + ECal *cal; + + group = e_source_group_new ("", uri); + source = e_source_new ("", ""); + e_source_set_group (source, group); + + /* we explicitly check for groupwise:// uris, to force authentication on them */ + if (!strncmp (uri, "groupwise://", strlen ("groupwise://"))) { + e_source_set_property (source, "auth", "yes"); + /* FIXME: need to retrieve the username */ + } + + cal = auth_new_cal_from_source (source, type); + + g_object_unref (source); + g_object_unref (group); + + return cal; +} diff --git a/calendar/common/authentication.h b/calendar/common/authentication.h new file mode 100644 index 0000000000..cc022a12dd --- /dev/null +++ b/calendar/common/authentication.h @@ -0,0 +1,33 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * Authors : + * Rodrigo Moya <rodrigo@ximian.com> + * + * Copyright 2003, Novell, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +#ifndef _AUTHENTICATION_H_ +#define _AUTHENTICATION_H_ + +#include <libedataserver/e-source.h> +#include <libecal/e-cal.h> + +ECal *auth_new_cal_from_source (ESource *source, ECalSourceType type); +ECal *auth_new_cal_from_uri (const char *uri, ECalSourceType type); + +#endif diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am index 217dbc557a..a6e4ab0f66 100644 --- a/calendar/gui/Makefile.am +++ b/calendar/gui/Makefile.am @@ -213,6 +213,7 @@ libevolution_calendar_la_SOURCES = \ libevolution_calendar_la_LIBADD = \ $(top_builddir)/widgets/menus/libmenus.la \ $(top_builddir)/shell/libeshell.la \ + $(top_builddir)/calendar/common/libevolution-calendarprivate.la \ $(top_builddir)/calendar/gui/dialogs/libcal-dialogs.la \ $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \ $(top_builddir)/widgets/misc/libemiscwidgets.la \ diff --git a/calendar/gui/alarm-notify/Makefile.am b/calendar/gui/alarm-notify/Makefile.am index e5653e4433..8d1772b6b7 100644 --- a/calendar/gui/alarm-notify/Makefile.am +++ b/calendar/gui/alarm-notify/Makefile.am @@ -21,6 +21,7 @@ INCLUDES = \ -DG_LOG_DOMAIN=\"evolution-alarm-notify\" \ -I$(top_srcdir) \ -I$(top_srcdir)/widgets \ + -I$(top_srcdir)/calendar \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ @@ -49,6 +50,7 @@ evolution_alarm_notify_SOURCES = \ evolution_alarm_notify_LDADD = \ $(top_builddir)/e-util/libeutil.la \ + $(top_builddir)/calendar/common/libevolution-calendarprivate.la \ $(EVOLUTION_CALENDAR_LIBS) server_in_files = GNOME_Evolution_Calendar_AlarmNotify.server.in.in diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c index 87b885ed6a..b1efc7b5f1 100644 --- a/calendar/gui/alarm-notify/alarm-notify.c +++ b/calendar/gui/alarm-notify/alarm-notify.c @@ -27,6 +27,7 @@ #include "alarm-notify.h" #include "alarm-queue.h" #include "save.h" +#include "common/authentication.h" #include "e-util/e-url.h" @@ -173,7 +174,7 @@ alarm_notify_add_calendar (AlarmNotify *an, const char *str_uri, gboolean load_a if (g_hash_table_lookup (priv->uri_client_hash, str_uri)) return; - client = e_cal_new_from_uri (str_uri, E_CAL_SOURCE_TYPE_EVENT); + client = auth_new_cal_from_uri (str_uri, E_CAL_SOURCE_TYPE_EVENT); if (client) { if (e_cal_open (client, FALSE, NULL)) { diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 6a5427bbf3..c9be642fbd 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -38,6 +38,7 @@ #include "migration.h" #include "e-comp-editor-registry.h" #include "comp-util.h" +#include "common/authentication.h" #include "dialogs/new-calendar.h" #include "dialogs/comp-editor.h" #include "dialogs/copy-source-dialog.h" @@ -693,14 +694,14 @@ setup_create_ecal (CalendarComponent *calendar_component) source = e_source_list_peek_source_by_uid (priv->source_list, uid); g_free (uid); - priv->create_ecal = e_cal_new (source, E_CAL_SOURCE_TYPE_EVENT); + priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); } if (!priv->create_ecal) { /* Try to create a default if there isn't one */ source = find_first_source (priv->source_list); if (source) - priv->create_ecal = e_cal_new (source, E_CAL_SOURCE_TYPE_EVENT); + priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); } if (priv->create_ecal) { diff --git a/calendar/gui/calendar-offline-handler.c b/calendar/gui/calendar-offline-handler.c index 4faf15bf7e..99257c3ca7 100644 --- a/calendar/gui/calendar-offline-handler.c +++ b/calendar/gui/calendar-offline-handler.c @@ -34,6 +34,7 @@ #include "e-util/e-url.h" #include <libecal/e-cal.h> #include "calendar-offline-handler.h" +#include "common/authentication.h" #define PARENT_TYPE bonobo_object_get_type () static BonoboObjectClass *parent_class = NULL; @@ -184,7 +185,7 @@ backend_go_offline (gpointer data, gpointer user_data) GError *error = NULL; /* FIXME This should not use LAST */ - client = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_LAST); + client = auth_new_cal_from_uri (uri, E_CAL_SOURCE_TYPE_LAST); g_signal_connect (client, "cal_opened", G_CALLBACK (backend_cal_opened_offline), offline_handler); success = e_cal_open (client, TRUE, &error); if (!success) { @@ -206,7 +207,7 @@ backend_go_online (gpointer data, gpointer user_data) GError *error = NULL; /* FIXME This should not use LAST */ - client = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_LAST); + client = auth_new_cal_from_uri (uri, E_CAL_SOURCE_TYPE_LAST); g_signal_connect (G_OBJECT (client), "cal_opened", G_CALLBACK (backend_cal_opened_online), offline_handler); success = e_cal_open (client, TRUE, &error); @@ -330,7 +331,7 @@ calendar_offline_handler_init (CalendarOfflineHandler *offline_handler) /* FIXME This should not use LAST */ /* FIXME: what URI to use? */ - priv->client = e_cal_new_from_uri ("", E_CAL_SOURCE_TYPE_LAST); + priv->client = auth_new_cal_from_uri ("", E_CAL_SOURCE_TYPE_LAST); priv->listener_interface = CORBA_OBJECT_NIL; priv->is_offline = FALSE; } diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c index 1bb14c00f9..05a36f62f8 100644 --- a/calendar/gui/comp-editor-factory.c +++ b/calendar/gui/comp-editor-factory.c @@ -32,6 +32,7 @@ #include "e-comp-editor-registry.h" #include "comp-editor-factory.h" #include "comp-util.h" +#include "common/authentication.h" #include "dialogs/event-editor.h" #include "dialogs/task-editor.h" @@ -496,7 +497,7 @@ open_client (CompEditorFactory *factory, const char *uristr) priv = factory->priv; /* FIXME get the type here */ - client = e_cal_new_from_uri (uristr, E_CAL_SOURCE_TYPE_LAST); + client = auth_new_cal_from_uri (uristr, E_CAL_SOURCE_TYPE_LAST); if (!client) return NULL; diff --git a/calendar/gui/dialogs/copy-source-dialog.c b/calendar/gui/dialogs/copy-source-dialog.c index 1dc440d0ec..1bf4cae4a6 100644 --- a/calendar/gui/dialogs/copy-source-dialog.c +++ b/calendar/gui/dialogs/copy-source-dialog.c @@ -25,6 +25,7 @@ #include <bonobo/bonobo-i18n.h> #include <widgets/misc/e-source-option-menu.h> #include "copy-source-dialog.h" +#include "common/authentication.h" typedef struct { GtkWidget *dialog; @@ -65,7 +66,7 @@ copy_source (CopySourceDialogData *csdd) return FALSE; /* open the source */ - source_client = e_cal_new (csdd->orig_source, csdd->obj_type); + source_client = auth_new_cal_from_source (csdd->orig_source, csdd->obj_type); if (!e_cal_open (source_client, TRUE, NULL)) { g_object_unref (source_client); g_warning (G_STRLOC ": Could not open source"); @@ -73,7 +74,7 @@ copy_source (CopySourceDialogData *csdd) } /* open the destination */ - dest_client = e_cal_new (csdd->selected_source, csdd->obj_type); + dest_client = auth_new_cal_from_source (csdd->selected_source, csdd->obj_type); if (!e_cal_open (dest_client, FALSE, NULL)) { g_object_unref (dest_client); g_object_unref (source_client); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 9a6b9c25ba..c4adf1e7fe 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -33,6 +33,7 @@ #include <libgnome/gnome-i18n.h> #include <glade/glade.h> #include <gal/widgets/e-categories.h> +#include "common/authentication.h" #include "e-util/e-categories-config.h" #include "e-util/e-dialog-widgets.h" #include "widgets/misc/e-dateedit.h" @@ -1212,7 +1213,7 @@ source_changed_cb (GtkWidget *widget, ESource *source, gpointer data) if (!priv->updating) { ECal *client; - client = e_cal_new (source, E_CAL_SOURCE_TYPE_EVENT); + client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); if (!client || !e_cal_open (client, FALSE, NULL)) { GtkWidget *dialog; diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 69bad550cc..094e92905c 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -37,6 +37,7 @@ #include <gal/widgets/e-categories.h> #include <widgets/misc/e-dateedit.h> #include "widgets/misc/e-source-option-menu.h" +#include "common/authentication.h" #include "e-util/e-dialog-widgets.h" #include "e-util/e-categories-config.h" #include "../e-timezone-entry.h" @@ -794,7 +795,7 @@ source_changed_cb (GtkWidget *widget, ESource *source, gpointer data) if (!priv->updating) { ECal *client; - client = e_cal_new (source, E_CAL_SOURCE_TYPE_TODO); + client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); if (!client || !e_cal_open (client, FALSE, NULL)) { GtkWidget *dialog; diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h index 652efc7399..7907b80d18 100644 --- a/calendar/gui/e-day-view.h +++ b/calendar/gui/e-day-view.h @@ -33,9 +33,7 @@ #include "e-cal-view.h" #include "gnome-cal.h" -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * EDayView - displays the Day & Work-Week views of the calendar. @@ -579,8 +577,6 @@ void e_day_view_ensure_rows_visible (EDayView *day_view, gint end_row); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* _E_DAY_VIEW_H_ */ diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index 40b5487e60..83f6abf2d2 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -54,6 +54,7 @@ #include "calendar-config.h" #include "itip-utils.h" #include "e-itip-control.h" +#include "common/authentication.h" struct _EItipControlPrivate { GtkWidget *html; @@ -136,7 +137,7 @@ start_calendar_server (EItipControl *itip, ESource *source, ECalSourceType type) if (ecal) return ecal; - ecal = e_cal_new (source, type); + ecal = auth_new_cal_from_source (source, type); if (!e_cal_open (ecal, TRUE, NULL)) return NULL; diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 66c51b9032..53922fb4df 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -46,8 +46,8 @@ #include "comp-util.h" #include "e-calendar-table-config.h" #include "misc.h" - #include "e-tasks.h" +#include "common/authentication.h" /* Private part of the GnomeCalendar structure */ @@ -850,7 +850,7 @@ e_tasks_add_todo_uri (ETasks *tasks, const char *str_uri) if (client) return TRUE; - client = e_cal_new_from_uri (str_uri, E_CAL_SOURCE_TYPE_TODO); + client = auth_new_cal_from_uri (str_uri, E_CAL_SOURCE_TYPE_TODO); g_hash_table_insert (priv->clients, g_strdup (str_uri), client); priv->clients_list = g_list_prepend (priv->clients_list, client); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 852c103809..96198a3d2e 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -67,6 +67,7 @@ #include "tag-calendar.h" #include "misc.h" #include "ea-calendar.h" +#include "common/authentication.h" @@ -2031,7 +2032,7 @@ gnome_calendar_construct (GnomeCalendar *gcal) /* * TaskPad Folder Client. */ - priv->task_pad_client = e_cal_new_from_uri ("", E_CAL_SOURCE_TYPE_TODO); /* FIXME: use default tasks */ + priv->task_pad_client = auth_new_cal_from_uri ("", E_CAL_SOURCE_TYPE_TODO); /* FIXME: use default tasks */ if (!priv->task_pad_client) return NULL; @@ -2160,7 +2161,7 @@ gnome_calendar_add_event_uri (GnomeCalendar *gcal, const char *str_uri) if (client) return TRUE; - client = e_cal_new_from_uri (str_uri, E_CAL_SOURCE_TYPE_EVENT); + client = auth_new_cal_from_uri (str_uri, E_CAL_SOURCE_TYPE_EVENT); if (!client) return FALSE; diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 3c8650afd1..f41ff908f7 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -39,6 +39,7 @@ #include "migration.h" #include "comp-util.h" #include "calendar-config.h" +#include "common/authentication.h" #include "dialogs/comp-editor.h" #include "dialogs/copy-source-dialog.h" #include "dialogs/new-task-list.h" @@ -643,14 +644,14 @@ setup_create_ecal (TasksComponent *component) source = e_source_list_peek_source_by_uid (priv->source_list, uid); g_free (uid); - priv->create_ecal = e_cal_new (source, E_CAL_SOURCE_TYPE_TODO); + priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); } if (!priv->create_ecal) { /* Try to create a default if there isn't one */ source = find_first_source (priv->source_list); if (source) - priv->create_ecal = e_cal_new (source, E_CAL_SOURCE_TYPE_TODO); + priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); } if (priv->create_ecal) { diff --git a/calendar/importers/Makefile.am b/calendar/importers/Makefile.am index a36c7ef4a6..84867931a6 100644 --- a/calendar/importers/Makefile.am +++ b/calendar/importers/Makefile.am @@ -23,7 +23,8 @@ libevolution_calendar_importers_la_SOURCES = \ libevolution_calendar_importers_la_LDFLAGS = -avoid-version -module libevolution_calendar_importers_la_LIBADD = \ - $(top_builddir)/shell/importer/libevolution-importer.la \ + $(top_builddir)/shell/importer/libevolution-importer.la \ + $(top_builddir)/calendar/common/libevolution-calendarprivate.la \ $(IMPORTERS_LIBS) # evolution_calendar_importer_SOURCES = \ @@ -50,4 +51,4 @@ CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = $(server_in_files) dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES)
\ No newline at end of file + cd $(distdir); rm -f $(BUILT_SOURCES) diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index ba9478ac8f..c1b237e0d5 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -38,6 +38,7 @@ #include <importer/GNOME_Evolution_Importer.h> #include <libical/icalvcal.h> #include "evolution-calendar-importer.h" +#include "common/authentication.h" /* We timeout after 2 minutes, when opening the folders. */ #define IMPORTER_TIMEOUT_SECONDS 120 @@ -374,9 +375,9 @@ load_file_fn (EvolutionImporter *importer, /* create ECal's */ if (!ici->client) - ici->client = e_cal_new_from_uri (real_uri, E_CAL_SOURCE_TYPE_EVENT); + ici->client = auth_new_cal_from_uri (real_uri, E_CAL_SOURCE_TYPE_EVENT); if (!ici->tasks_client) - ici->tasks_client = e_cal_new_from_uri ("", E_CAL_SOURCE_TYPE_TODO); /* FIXME */ + ici->tasks_client = auth_new_cal_from_uri ("", E_CAL_SOURCE_TYPE_TODO); /* FIXME */ if (e_cal_open (ici->client, TRUE, NULL) && e_cal_open (ici->tasks_client, FALSE, NULL)) { @@ -526,9 +527,9 @@ vcal_load_file_fn (EvolutionImporter *importer, /* create ECal's */ if (!ici->client) - ici->client = e_cal_new_from_uri (real_uri, E_CAL_SOURCE_TYPE_EVENT); + ici->client = auth_new_cal_from_uri (real_uri, E_CAL_SOURCE_TYPE_EVENT); if (!ici->tasks_client) - ici->tasks_client = e_cal_new_from_uri ("", E_CAL_SOURCE_TYPE_TODO); + ici->tasks_client = auth_new_cal_from_uri ("", E_CAL_SOURCE_TYPE_TODO); if (e_cal_open (ici->client, TRUE, NULL) && e_cal_open (ici->tasks_client, FALSE, NULL)) { @@ -614,13 +615,13 @@ gnome_calendar_import_data_fn (EvolutionIntelligentImporter *ii, /* Try to open the default calendar & tasks folders. */ if (ici->do_calendar) { - calendar_client = e_cal_new_from_uri ("", E_CAL_SOURCE_TYPE_EVENT); /* FIXME: use default folder */ + calendar_client = auth_new_cal_from_uri ("", E_CAL_SOURCE_TYPE_EVENT); /* FIXME: use default folder */ if (!e_cal_open (calendar_client, FALSE, NULL)) goto out; } if (ici->do_tasks) { - tasks_client = e_cal_new_from_uri ("", E_CAL_SOURCE_TYPE_TODO); /* FIXME: use default folder */ + tasks_client = auth_new_cal_from_uri ("", E_CAL_SOURCE_TYPE_TODO); /* FIXME: use default folder */ if (!e_cal_open (tasks_client, FALSE, NULL)) goto out; } |