From: Sarfraaz Ahmed Date: Wed, 28 Sep 2005 13:18:01 +0000 (+0000) Subject: Do not recreate the uri. Instead strip the uri part after a ';'. The X-Git-Tag: upstream/3.7.4~6867 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5930c86d515acdf6a891e48cf6da8d41f1130d02;p=platform%2Fupstream%2Fevolution-data-server.git Do not recreate the uri. Instead strip the uri part after a ';'. The 2005-09-27 Sarfraaz Ahmed * libecal/e-cal.c (build_pass_key) : Do not recreate the uri. Instead strip the uri part after a ';'. The backend can now set its uri accordingly to have a consistent password key across multiple calendars * libedata-cal/e-data-cal-factory.c (impl_CalFactory_getCal) : Use the esource uri instead of the euri string to identify the calendar. Fixes #314746 --- diff --git a/calendar/ChangeLog b/calendar/ChangeLog index e4202c5..866aeba 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2005-09-27 Sarfraaz Ahmed + + * libecal/e-cal.c (build_pass_key) : Do not recreate the uri. Instead + strip the uri part after a ';'. The backend can now set its uri + accordingly to have a consistent password key across multiple calendars + * libedata-cal/e-data-cal-factory.c (impl_CalFactory_getCal) : Use the + esource uri instead of the euri string to identify the calendar. + Fixes #314746 + 2005-09-26 Wang Xin Fixes #317226 diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c index 93f495e..e3a942c 100644 --- a/calendar/libecal/e-cal.c +++ b/calendar/libecal/e-cal.c @@ -1583,50 +1583,17 @@ e_cal_set_auth_func (ECal *ecal, ECalAuthFunc func, gpointer data) } static char * -get_host_from_uri (const char *uri) -{ - char *at = strchr (uri, '@'); - char *slash; - int length; - - if (!at) - return NULL; - at++; /* Parse over the @ symbol */ - slash = strchr (at, '/'); - if (!slash) - return NULL; - slash --; /* Walk back */ - - length = slash - at; - - return g_strndup (at, length); -} - -static char * build_pass_key (ESource *source) { - const char *base_uri, *user_name, *auth_type, *rel_uri; - char *uri, *new_uri, *host_name; - ESourceGroup *es_grp; - - es_grp = e_source_peek_group (source); - base_uri = e_source_group_peek_base_uri (es_grp); - if (base_uri) { - user_name = e_source_get_property (source, "username"); - auth_type = e_source_get_property (source, "auth-type"); - rel_uri = e_source_peek_relative_uri (source); - host_name = get_host_from_uri (rel_uri); - if (host_name) { - new_uri = g_strdup_printf ("%s%s;%s@%s/", base_uri, user_name, auth_type, host_name); - g_free (host_name); - - return new_uri; - } - } + char *uri, *euri_str; + EUri *euri; uri = e_source_get_uri (source); - return uri; + euri = e_uri_new (uri); + euri_str = e_uri_to_string (euri, FALSE); + g_free (uri); + return euri_str; } static gboolean diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c index 223a77c..4de4b34 100644 --- a/calendar/libedata-cal/e-data-cal-factory.c +++ b/calendar/libedata-cal/e-data-cal-factory.c @@ -197,14 +197,12 @@ impl_CalFactory_getCal (PortableServer_Servant servant, /* Parse the uri */ uri = e_uri_new (str_uri); - g_free (str_uri); - if (!uri) { bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_CalFactory_InvalidURI); return CORBA_OBJECT_NIL; } - str_uri = e_uri_to_string(uri, FALSE); + uri_type_string = g_strdup_printf ("%s:%d", str_uri, (int)calobjtype_to_icalkind (type)); g_free(str_uri);