aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2004-07-10 00:13:43 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2004-07-10 00:13:43 +0800
commit6e8aede2ccc77248fe05cf6e6de063a02bf33584 (patch)
tree46b8e284b69cbbaa4c5d25852c251a79b1dfd357
parent88dde99035dcb3ec05332f6c63bd37aab0da6d7e (diff)
downloadgsoc2013-evolution-6e8aede2ccc77248fe05cf6e6de063a02bf33584.tar.gz
gsoc2013-evolution-6e8aede2ccc77248fe05cf6e6de063a02bf33584.tar.zst
gsoc2013-evolution-6e8aede2ccc77248fe05cf6e6de063a02bf33584.zip
Fixes #60289
2004-07-09 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. (transfer_selected_items): don't pass hardcoded values to transfer_item_to. svn path=/trunk/; revision=26608
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/gui/dialogs/select-source-dialog.c13
-rw-r--r--calendar/gui/e-calendar-view.c17
3 files changed, 39 insertions, 3 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 8776b8721e..10fae83455 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,15 @@
+2004-07-09 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.
+ (transfer_selected_items): don't pass hardcoded values to transfer_item_to.
+
2004-07-08 Frederic Crozat <fcrozat@mandrakesoft.com>
* gui/Makefile.am:
diff --git a/calendar/gui/dialogs/select-source-dialog.c b/calendar/gui/dialogs/select-source-dialog.c
index 04f6ab228a..b676cadb0a 100644
--- a/calendar/gui/dialogs/select-source-dialog.c
+++ b/calendar/gui/dialogs/select-source-dialog.c
@@ -156,7 +156,18 @@ select_source_dialog (GtkWindow *parent, ECalSourceType obj_type)
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;
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 46d8722fda..2150ca0993 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -1113,12 +1113,25 @@ transfer_item_to (ECalendarViewEvent *event, ECal *dest_client, gboolean remove_
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 */
@@ -1158,7 +1171,7 @@ transfer_selected_items (ECalendarView *cal_view, gboolean remove_item)
e_calendar_view_set_status_message (cal_view, _("Copying items"));
for (l = selected; l != NULL; l = l->next)
- transfer_item_to ((ECalendarViewEvent *) l->data, dest_client, TRUE);
+ transfer_item_to ((ECalendarViewEvent *) l->data, dest_client, remove_item);
e_calendar_view_set_status_message (cal_view, NULL);