[evolution-patches] calendar : fix for bug #314746



Hi,

Resending this patch now. Please review it.

Thanks
-- Sarfraaz
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.510.2.3
diff -u -p -u -p -r1.510.2.3 ChangeLog
--- ChangeLog	27 Sep 2005 09:38:18 -0000	1.510.2.3
+++ ChangeLog	27 Sep 2005 12:49:35 -0000
@@ -1,3 +1,11 @@
+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.
+
 2005-09-26  Wang Xin  <jedy wang sun com>
 
 	Fixes #317226
Index: libecal/e-cal.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal.c,v
retrieving revision 1.113
diff -u -p -u -p -r1.113 e-cal.c
--- libecal/e-cal.c	31 Aug 2005 04:21:54 -0000	1.113
+++ libecal/e-cal.c	27 Sep 2005 12:49:36 -0000
@@ -1583,50 +1583,19 @@ e_cal_set_auth_func (ECal *ecal, ECalAut
 }
 
 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);
+	printf ("esource uri : %s\n", uri);
 
-	return uri;
+	euri = e_uri_new (uri);
+	euri_str = e_uri_to_string (euri, FALSE);
+	printf ("euri_str : %s\n", euri_str);
+	g_free (uri);
+	return euri_str;
 }
 
 static gboolean
Index: libedata-cal/e-data-cal-factory.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libedata-cal/e-data-cal-factory.c,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 e-data-cal-factory.c
--- libedata-cal/e-data-cal-factory.c	31 Aug 2005 04:21:54 -0000	1.13
+++ libedata-cal/e-data-cal-factory.c	27 Sep 2005 12:49:36 -0000
@@ -197,14 +197,14 @@ impl_CalFactory_getCal (PortableServer_S
 
 	/* Parse the uri */
 	uri = e_uri_new (str_uri);
-	g_free (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);
+	//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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]