Re: [evolution-patches] patch for #60289 (calendar)



On Wed, 2004-07-07 at 13:58 +0200, Rodrigo Moya wrote:
> These 2 patches fix #60289

updated patch for the evolution part, making it change the UID of the
appointment when copying, as suggested by JP on IRC
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2436
diff -u -p -r1.2436 ChangeLog
--- ChangeLog	6 Jul 2004 15:10:16 -0000	1.2436
+++ ChangeLog	7 Jul 2004 16:01:47 -0000
@@ -1,3 +1,14 @@
+2004-07-07  Rodrigo Moya <rodrigo novell com>
+
+	Fixes #60289
+
+	* gui/dialogs/select-source-dialog.c (select_source_dialog): set the
+	absolute URI on the selected source, so that the ESource we keep
+	around has a valid URI.
+
+	* gui/e-calendar-view.c (transfer_item_to): when copying appointments,
+	change the UID.
+
 2004-07-06  Rodrigo Moya <rodrigo novell com>
 
 	* gui/gnome-cal.c (gnome_calendar_init): setup the widgets before
Index: gui/e-calendar-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-view.c,v
retrieving revision 1.58
diff -u -p -r1.58 e-calendar-view.c
--- gui/e-calendar-view.c	6 Jul 2004 13:53:00 -0000	1.58
+++ gui/e-calendar-view.c	7 Jul 2004 16:01:47 -0000
@@ -1113,12 +1113,25 @@ transfer_item_to (ECalendarViewEvent *ev
 		if (!e_cal_modify_object (dest_client, event->comp_data->icalcomp, CALOBJ_MOD_ALL, NULL))
 			return;
 	} else {
+		orig_icalcomp = icalcomponent_new_clone (event->comp_data->icalcomp);
+
+		if (!remove_item) {
+			/* change the UID to avoid problems with duplicated UIDs */
+			new_uid = e_cal_component_gen_uid ();
+			icalcomponent_set_uid (orig_icalcomp, new_uid);
+
+			g_free (new_uid);
+		}
+
 		new_uid = NULL;
-		if (!e_cal_create_object (dest_client, event->comp_data->icalcomp, &new_uid, NULL))
+		if (!e_cal_create_object (dest_client, orig_icalcomp, &new_uid, NULL)) {
+			icalcomponent_free (orig_icalcomp);
 			return;
+		}
 
 		if (new_uid)
 			g_free (new_uid);
+		icalcomponent_free (orig_icalcomp);
 	}
 
 	/* remove the item from the source calendar */
Index: gui/dialogs/select-source-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/select-source-dialog.c,v
retrieving revision 1.9
diff -u -p -r1.9 select-source-dialog.c
--- gui/dialogs/select-source-dialog.c	21 Jun 2004 21:10:47 -0000	1.9
+++ gui/dialogs/select-source-dialog.c	7 Jul 2004 16:01:48 -0000
@@ -156,7 +156,18 @@ select_source_dialog (GtkWindow *parent,
 		g_list_free (icon_list);
 	}
 	
-	if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK) {
+	if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
+		if (selected_source) {
+			char *absolute_uri;
+
+			/* set the absolute URI on the source we keep around, since the group
+			   will be unrefed */
+			absolute_uri = e_source_build_absolute_uri (selected_source);
+			e_source_set_absolute_uri (selected_source, (const char *) absolute_uri);
+
+			g_free (absolute_uri);
+		}
+	} else {
 		if (selected_source)
 			g_object_unref (selected_source);
 		selected_source = NULL;


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