From d635b839f8d22746f44067464dc3c645aeeb8591 Mon Sep 17 00:00:00 2001 From: Gustavo Noronha Silva Date: Fri, 22 Jan 2010 18:14:32 -0200 Subject: Make authentication functionality available This involves renaming the calendar auth-related functions to have a prefix, and shipping the headers. Part of https://bugzilla.gnome.org/show_bug.cgi?id=608175 --- calendar/common/Makefile.am | 4 ++++ calendar/common/authentication.c | 10 +++++----- calendar/common/authentication.h | 8 ++++---- calendar/gui/alarm-notify/alarm-notify.c | 2 +- calendar/gui/comp-util.c | 2 +- calendar/gui/dialogs/copy-source-dialog.c | 4 ++-- calendar/gui/dialogs/event-page.c | 2 +- calendar/gui/dialogs/memo-page.c | 2 +- calendar/gui/dialogs/task-page.c | 2 +- calendar/gui/e-calendar-selector.c | 2 +- calendar/gui/e-itip-control.c | 2 +- calendar/gui/e-memo-list-selector.c | 4 ++-- calendar/gui/e-task-list-selector.c | 4 ++-- calendar/gui/gnome-cal.c | 6 +++--- calendar/importers/icalendar-importer.c | 6 +++--- 15 files changed, 32 insertions(+), 28 deletions(-) (limited to 'calendar') diff --git a/calendar/common/Makefile.am b/calendar/common/Makefile.am index 342a9b6df5..5a6c18f417 100644 --- a/calendar/common/Makefile.am +++ b/calendar/common/Makefile.am @@ -1,5 +1,9 @@ noinst_LTLIBRARIES = libevolution-calendarprivate.la +ecalendarcommonincludedir = $(privincludedir)/calendar/common +ecalendarcommoninclude_HEADERS = \ + authentication.h + libevolution_calendarprivate_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DG_LOG_DOMAIN=\"calendar-gui\" \ diff --git a/calendar/common/authentication.c b/calendar/common/authentication.c index 7b0b2e7972..baacc1ead4 100644 --- a/calendar/common/authentication.c +++ b/calendar/common/authentication.c @@ -73,7 +73,7 @@ build_pass_key (ECal *ecal) } void -auth_cal_forget_password (ECal *ecal) +e_auth_cal_forget_password (ECal *ecal) { ESource *source = NULL; const gchar *auth_domain = NULL, *component_name = NULL, *auth_type = NULL; @@ -95,7 +95,7 @@ auth_cal_forget_password (ECal *ecal) } ECal * -auth_new_cal_from_default (ECalSourceType type) +e_auth_new_cal_from_default (ECalSourceType type) { ECal *ecal = NULL; @@ -106,7 +106,7 @@ auth_new_cal_from_default (ECalSourceType type) } ECal * -auth_new_cal_from_source (ESource *source, ECalSourceType type) +e_auth_new_cal_from_source (ESource *source, ECalSourceType type) { ECal *cal; @@ -118,7 +118,7 @@ auth_new_cal_from_source (ESource *source, ECalSourceType type) } ECal * -auth_new_cal_from_uri (const gchar *uri, ECalSourceType type) +e_auth_new_cal_from_uri (const gchar *uri, ECalSourceType type) { ESourceGroup *group = NULL; ESource *source = NULL; @@ -172,7 +172,7 @@ auth_new_cal_from_uri (const gchar *uri, ECalSourceType type) } } - cal = auth_new_cal_from_source (source, type); + cal = e_auth_new_cal_from_source (source, type); g_object_unref (source); if (group) diff --git a/calendar/common/authentication.h b/calendar/common/authentication.h index 7d9d7f5fa7..e4e0599878 100644 --- a/calendar/common/authentication.h +++ b/calendar/common/authentication.h @@ -27,9 +27,9 @@ #include #include -ECal *auth_new_cal_from_default (ECalSourceType type); -ECal *auth_new_cal_from_source (ESource *source, ECalSourceType type); -ECal *auth_new_cal_from_uri (const gchar *uri, ECalSourceType type); -void auth_cal_forget_password (ECal *ecal); +ECal *e_auth_new_cal_from_default (ECalSourceType type); +ECal *e_auth_new_cal_from_source (ESource *source, ECalSourceType type); +ECal *e_auth_new_cal_from_uri (const gchar *uri, ECalSourceType type); +void e_auth_cal_forget_password (ECal *ecal); #endif diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c index 5651a61182..7ad414c61c 100644 --- a/calendar/gui/alarm-notify/alarm-notify.c +++ b/calendar/gui/alarm-notify/alarm-notify.c @@ -384,7 +384,7 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalSourceType source_type, ESource } } - client = auth_new_cal_from_source (source, source_type); + client = e_auth_new_cal_from_source (source, source_type); if (client) { d (printf("%s:%d (alarm_notify_add_calendar) %s - Calendar Open Async... %p\n", __FILE__, __LINE__, str_uri, client)); diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index c5254a427f..a8fa9aef72 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -749,7 +749,7 @@ cal_comp_process_source_list_drop (ECal *destination, icalcomponent *comp, GdkDr source_source = e_source_list_peek_source_by_uid (source_list, source_uid); if (source_source && !E_IS_SOURCE_GROUP (source_source) && !e_source_get_readonly (source_source)) { - source_client = auth_new_cal_from_source (source_source, e_cal_get_source_type (destination)); + source_client = e_auth_new_cal_from_source (source_source, e_cal_get_source_type (destination)); if (source_client) { gboolean read_only = TRUE; diff --git a/calendar/gui/dialogs/copy-source-dialog.c b/calendar/gui/dialogs/copy-source-dialog.c index 095d10131d..aafe66a90f 100644 --- a/calendar/gui/dialogs/copy-source-dialog.c +++ b/calendar/gui/dialogs/copy-source-dialog.c @@ -86,7 +86,7 @@ copy_source (CopySourceDialogData *csdd) return FALSE; /* open the source */ - source_client = auth_new_cal_from_source (csdd->orig_source, csdd->obj_type); + source_client = e_auth_new_cal_from_source (csdd->orig_source, csdd->obj_type); if (!e_cal_open (source_client, TRUE, NULL)) { show_error (NULL, _("Could not open source")); g_object_unref (source_client); @@ -94,7 +94,7 @@ copy_source (CopySourceDialogData *csdd) } /* open the destination */ - dest_client = auth_new_cal_from_source (csdd->selected_source, csdd->obj_type); + dest_client = e_auth_new_cal_from_source (csdd->selected_source, csdd->obj_type); if (!e_cal_open (dest_client, FALSE, NULL)) { show_error (NULL, _("Could not open destination")); g_object_unref (dest_client); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index b10932d0ad..bef407c8dd 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -2564,7 +2564,7 @@ source_changed_cb (ESourceComboBox *source_combo_box, EventPage *epage) editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage)); source = e_source_combo_box_get_active (source_combo_box); - client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); + client = e_auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); if (client) { icaltimezone *zone; diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 949836a330..f5c6a26400 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -855,7 +855,7 @@ source_changed_cb (ESourceComboBox *source_combo_box, flags = comp_editor_get_flags (editor); source = e_source_combo_box_get_active (source_combo_box); - client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_JOURNAL); + client = e_auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_JOURNAL); 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 5bff292b37..33413250ad 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -1675,7 +1675,7 @@ source_changed_cb (ESourceComboBox *source_combo_box, TaskPage *tpage) if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage))) return; - client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); + client = e_auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); if (client) { icaltimezone *zone; diff --git a/calendar/gui/e-calendar-selector.c b/calendar/gui/e-calendar-selector.c index d46b4dad18..14c635b698 100644 --- a/calendar/gui/e-calendar-selector.c +++ b/calendar/gui/e-calendar-selector.c @@ -131,7 +131,7 @@ calendar_selector_data_dropped (ESourceSelector *selector, icalcomponent_set_uid (icalcomp, uid); } - client = auth_new_cal_from_source ( + client = e_auth_new_cal_from_source ( destination, E_CAL_SOURCE_TYPE_EVENT); if (client != NULL) { diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index d1fe75a32d..c941310a2e 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -184,7 +184,7 @@ start_calendar_server (EItipControl *itip, ESource *source, ECalSourceType type, return ecal; } - ecal = auth_new_cal_from_source (source, type); + ecal = e_auth_new_cal_from_source (source, type); zone = calendar_config_get_icaltimezone (); e_cal_set_default_timezone (ecal, zone, NULL); diff --git a/calendar/gui/e-memo-list-selector.c b/calendar/gui/e-memo-list-selector.c index e31a9d4b6e..d84a70b3b3 100644 --- a/calendar/gui/e-memo-list-selector.c +++ b/calendar/gui/e-memo-list-selector.c @@ -156,7 +156,7 @@ memo_list_selector_process_data (ESourceSelector *selector, if (!E_IS_SOURCE (source) || e_source_get_readonly (source)) goto exit; - client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_JOURNAL); + client = e_auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_JOURNAL); if (client == NULL) { g_message ("Cannot create source client to remove old memo"); goto exit; @@ -187,7 +187,7 @@ memo_list_selector_data_dropped (ESourceSelector *selector, GSList *list, *iter; gboolean success = FALSE; - client = auth_new_cal_from_source ( + client = e_auth_new_cal_from_source ( destination, E_CAL_SOURCE_TYPE_JOURNAL); if (client == NULL || !e_cal_open (client, TRUE, NULL)) diff --git a/calendar/gui/e-task-list-selector.c b/calendar/gui/e-task-list-selector.c index fa6bd328d9..34432b0ed4 100644 --- a/calendar/gui/e-task-list-selector.c +++ b/calendar/gui/e-task-list-selector.c @@ -157,7 +157,7 @@ task_list_selector_process_data (ESourceSelector *selector, if (!E_IS_SOURCE (source) || e_source_get_readonly (source)) goto exit; - client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); + client = e_auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); if (client == NULL) { g_message ("Cannot create source client to remove old task"); goto exit; @@ -188,7 +188,7 @@ task_list_selector_data_dropped (ESourceSelector *selector, GSList *list, *iter; gboolean success = FALSE; - client = auth_new_cal_from_source ( + client = e_auth_new_cal_from_source ( destination, E_CAL_SOURCE_TYPE_TODO); if (client == NULL || !e_cal_open (client, TRUE, NULL)) diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 6521d8d5d5..ea87a840f6 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1876,7 +1876,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) state = e_cal_get_load_state (ecal); if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) - auth_cal_forget_password (ecal); + e_auth_cal_forget_password (ecal); switch (status) { case E_CALENDAR_STATUS_OK: @@ -1967,7 +1967,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar state = e_cal_get_load_state (ecal); if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) - auth_cal_forget_password (ecal); + e_auth_cal_forget_password (ecal); switch (status) { case E_CALENDAR_STATUS_OK: @@ -2277,7 +2277,7 @@ gnome_calendar_set_default_source (GnomeCalendar *gcal, ESource *source) if (client) { priv->default_client = g_object_ref (client); } else { - priv->default_client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); + priv->default_client = e_auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); if (!priv->default_client) return FALSE; } diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index b7b2b515ad..1f7da5e421 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -321,7 +321,7 @@ ivcal_import(EImport *ei, EImportTarget *target, icalcomponent *icalcomp) type = GPOINTER_TO_INT(g_datalist_get_data(&target->data, "primary-type")); - client = auth_new_cal_from_source (g_datalist_get_data(&target->data, "primary-source"), type); + client = e_auth_new_cal_from_source (g_datalist_get_data(&target->data, "primary-source"), type); if (client) { ICalImporter *ici = g_malloc0(sizeof(*ici)); @@ -629,13 +629,13 @@ gnome_calendar_import(EImport *ei, EImportTarget *target, EImportImporter *im) /* Try to open the default calendar & tasks folders. */ if (do_calendar) { - calendar_client = auth_new_cal_from_default (E_CAL_SOURCE_TYPE_EVENT); + calendar_client = e_auth_new_cal_from_default (E_CAL_SOURCE_TYPE_EVENT); if (!calendar_client) goto out; } if (do_tasks) { - tasks_client = auth_new_cal_from_default (E_CAL_SOURCE_TYPE_TODO); + tasks_client = e_auth_new_cal_from_default (E_CAL_SOURCE_TYPE_TODO); if (!tasks_client) goto out; } -- cgit v1.2.3