[evolution-patches] Fix for #55922



hi,
 This is a fix for GW events showing up as tasks in the Task list.
The code checks for existing e_data_cal-s based on uri alone and not on
the type..and GW is the first exception in the journey of evolution ;)
where two different calobjs share the same uri.

harish

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.252
diff -u -p -r1.252 ChangeLog
--- ChangeLog	3 May 2004 14:13:55 -0000	1.252
+++ ChangeLog	3 May 2004 15:26:01 -0000
@@ -1,3 +1,12 @@
+2004-05-04  Harish Krishnaswamy  <kharish novell com>
+
+	Fixes #55922
+	
+	* libedata-cal/e-data-cal-factory.c: (impl_CalFactory_getCal):
+	Hash the backends based on the uri 'and' the type (Both calendar
+	and tasks for GW share the same uri but need different e-data-cal
instances.
+
 2004-05-03  JP Rosevear  <jpr ximian com>
 
 	Partial fix for #57218
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.6
diff -u -p -r1.6 e-data-cal-factory.c
--- libedata-cal/e-data-cal-factory.c	10 Jan 2004 22:45:38 -0000	1.6
+++ libedata-cal/e-data-cal-factory.c	3 May 2004 15:26:02 -0000
@@ -164,7 +164,7 @@ impl_CalFactory_getCal (PortableServer_S
 	ESource *source;
 	char *str_uri;
 	EUri *uri;
-	char *uri_string;
+	char *uri_type_string;
 	
 	factory = E_DATA_CAL_FACTORY (bonobo_object_from_servant (servant));
 	priv = factory->priv;
@@ -194,7 +194,7 @@ impl_CalFactory_getCal (PortableServer_S
 
 		return CORBA_OBJECT_NIL;
 	}
-	uri_string = e_uri_to_string (uri, FALSE);	
+	uri_type_string = g_strdup_printf ("%s:%d", e_uri_to_string (uri,
FALSE), type);	
 
 	/* Find the associated backend type (if any) */
 	backend_type = get_backend_type (priv->methods, uri->protocol,
calobjtype_to_icalkind (type));
@@ -217,7 +217,7 @@ impl_CalFactory_getCal (PortableServer_S
 	CORBA_exception_free (&ev2);
 
 	/* Look for an existing backend */
-	backend = lookup_backend (factory, uri_string);
+	backend = lookup_backend (factory, uri_type_string);
 	if (!backend) {
 		/* There was no existing backend, create a new one */
 		backend = g_object_new (backend_type, "source", source, "kind",
calobjtype_to_icalkind (type), NULL);
@@ -228,7 +228,7 @@ impl_CalFactory_getCal (PortableServer_S
 		}
 
 		/* Track the backend */
-		g_hash_table_insert (priv->backends, g_strdup (uri_string), backend);
+		g_hash_table_insert (priv->backends, g_strdup (uri_type_string),
backend);
 
 		g_signal_connect (G_OBJECT (backend), "last_client_gone",
 				  G_CALLBACK (backend_last_client_gone_cb),
@@ -236,7 +236,7 @@ impl_CalFactory_getCal (PortableServer_S
 	}
 	
 	/* Create the corba calendar */
-	cal = e_data_cal_new (backend, uri_string, listener);
+	cal = e_data_cal_new (backend, uri_type_string, listener);
 	if (!cal) {
 		g_warning (G_STRLOC ": could not create the corba calendar");
 		bonobo_exception_set (ev,
ex_GNOME_Evolution_Calendar_CalFactory_UnsupportedMethod);
@@ -248,7 +248,7 @@ impl_CalFactory_getCal (PortableServer_S
 	
  cleanup:
 	e_uri_free (uri);
-	g_free (uri_string);
+	g_free (uri_type_string);
 	g_object_unref (source);
 
 	return CORBA_Object_duplicate (BONOBO_OBJREF (cal), ev);





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