aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-01-15 23:07:46 +0800
committerMilan Crha <mcrha@src.gnome.org>2009-01-15 23:07:46 +0800
commit19265d6114dbc5ab7b4cc78a38dcafde13f37789 (patch)
tree68bfcede15a75c43186828ee6adc3a2b91cdbf78 /calendar/gui/gnome-cal.c
parent9a69a192221d827f263e6972b9f07031b62676ef (diff)
downloadgsoc2013-evolution-19265d6114dbc5ab7b4cc78a38dcafde13f37789.tar.gz
gsoc2013-evolution-19265d6114dbc5ab7b4cc78a38dcafde13f37789.tar.zst
gsoc2013-evolution-19265d6114dbc5ab7b4cc78a38dcafde13f37789.zip
** Fix for bug #303738
2009-01-15 Milan Crha <mcrha@redhat.com> ** Fix for bug #303738 * gui/gnome-cal.c: (client_cal_opened_cb), (default_client_cal_opened_cb): * gui/e-memos.c: (client_cal_opened_cb), (default_client_cal_opened_cb): * gui/e-tasks.c: (client_cal_opened_cb), (default_client_cal_opened_cb): Forget password on AuthFailed or AuthRequired and try to reopen on AuthFailed status, which will ask for a password again. * gui/comp-editor-factory.c: (cal_opened_cb): Show "Authentication Required" on such status returned. * common/authentication.c: (auth_cal_forget_password): Do not free memory which hold ECal. Also always forget password for calendar with the URL key. svn path=/trunk/; revision=37080
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index dcec360953..c2b1cb3d6c 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -2793,7 +2793,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal)
break;
}
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED && source_type == E_CAL_SOURCE_TYPE_EVENT)
+ if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
auth_cal_forget_password (ecal);
switch (status) {
@@ -2819,17 +2819,10 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal)
status = E_CALENDAR_STATUS_OK;
break;
- case E_CALENDAR_STATUS_AUTHENTICATION_FAILED:
- {
- const gchar *auth_domain = e_source_get_property (source, "auth-domain");
- const gchar *component_name;
-
- component_name = auth_domain ? auth_domain : "Calendar";
-
- /* Warn the user password is wrong */
- e_passwords_forget_password (component_name, e_cal_get_uri(ecal));
- return;
- }
+ case E_CALENDAR_STATUS_AUTHENTICATION_FAILED:
+ /* try to reopen calendar - it'll ask for a password once again */
+ e_cal_open_async (ecal, FALSE);
+ return;
case E_CALENDAR_STATUS_REPOSITORY_OFFLINE:
if (source_type == E_CAL_SOURCE_TYPE_EVENT)
{
@@ -2851,6 +2844,8 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal)
/* Make sure the source doesn't disappear on us */
g_object_ref (source);
+ g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal);
+
priv->clients_list[source_type] = g_list_remove (priv->clients_list[source_type], ecal);
g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source));
@@ -2915,6 +2910,9 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar
source = e_cal_get_source (ecal);
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);
+
switch (source_type) {
case E_CAL_SOURCE_TYPE_EVENT:
e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1);
@@ -2936,13 +2934,18 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar
if (state == E_CAL_LOAD_NOT_LOADED)
e_cal_open_async (ecal, FALSE);
return;
- case E_CALENDAR_STATUS_INVALID_SERVER_VERSION :
+ case E_CALENDAR_STATUS_AUTHENTICATION_FAILED:
+ /* try to reopen calendar - it'll ask for a password once again */
+ e_cal_open_async (ecal, FALSE);
+ return;
+ case E_CALENDAR_STATUS_INVALID_SERVER_VERSION:
e_error_run (NULL, "calendar:server-version", NULL);
- status = E_CALENDAR_STATUS_OK;
default:
/* Make sure the source doesn't disappear on us */
g_object_ref (source);
+ g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal);
+
/* FIXME should we do this to prevent multiple error dialogs? */
priv->clients_list[source_type] = g_list_remove (priv->clients_list[source_type], ecal);
g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source));
@@ -2962,7 +2965,6 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar
g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL);
-
switch (source_type) {
case E_CAL_SOURCE_TYPE_EVENT:
e_cal_model_set_default_client (