+2005-09-27 Sarfraaz Ahmed <asarfraaz@novell.com>
+
+ * 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 <jedy.wang@sun.com>
Fixes #317226
}
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
/* 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);