evolution r35382 - in trunk/calendar: . gui gui/dialogs



Author: mcrha
Date: Fri Apr 18 09:12:26 2008
New Revision: 35382
URL: http://svn.gnome.org/viewvc/evolution?rev=35382&view=rev

Log:
2008-04-18  Milan Crha  <mcrha redhat com>

	** Fix for bug #509923

	* gui/dialogs/comp-editor.c: (real_send_comp):
	* gui/e-calendar-view.c: (e_calendar_view_modify_and_send):
	* gui/e-cal-model-calendar.c: (ecmc_set_value_at):
	Send changes based on the user's choice of "all instances" or
	"only this instance" for recurring events.
	* gui/e-cal-model-calendar.c: (ecmc_set_value_at):
	Also modify objects based on the user's choice.



Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/gui/dialogs/comp-editor.c
   trunk/calendar/gui/e-cal-model-calendar.c
   trunk/calendar/gui/e-calendar-view.c

Modified: trunk/calendar/gui/dialogs/comp-editor.c
==============================================================================
--- trunk/calendar/gui/dialogs/comp-editor.c	(original)
+++ trunk/calendar/gui/dialogs/comp-editor.c	Fri Apr 18 09:12:26 2008
@@ -2609,7 +2609,7 @@
 real_send_comp (CompEditor *editor, ECalComponentItipMethod method)
 {
 	CompEditorPrivate *priv;
-	ECalComponent *send_comp;
+	ECalComponent *send_comp = NULL;
 	char *address = NULL;
 	GList *users = NULL;
 
@@ -2618,7 +2618,24 @@
 
 	priv = editor->priv;
 
-	send_comp = e_cal_component_clone (priv->comp);
+	if (priv->mod == CALOBJ_MOD_ALL && e_cal_component_is_instance (priv->comp)) {
+		/* Ensure we send the master object, not the instance only */
+		icalcomponent *icalcomp = NULL;
+		const char *uid = NULL;
+
+		e_cal_component_get_uid (priv->comp, &uid);
+		if (e_cal_get_object (priv->client, uid, NULL, &icalcomp, NULL) && icalcomp) {
+			send_comp = e_cal_component_new ();
+			if (!e_cal_component_set_icalcomponent (send_comp, icalcomp)) {
+				icalcomponent_free (icalcomp);
+				g_object_unref (send_comp);
+				send_comp = NULL;
+			}
+		}
+	}
+
+	if (!send_comp)
+		send_comp = e_cal_component_clone (priv->comp);
 
 	if (e_cal_component_get_vtype (send_comp) == E_CAL_COMPONENT_JOURNAL)
 		get_users_from_memo_comp (send_comp, &users);

Modified: trunk/calendar/gui/e-cal-model-calendar.c
==============================================================================
--- trunk/calendar/gui/e-cal-model-calendar.c	(original)
+++ trunk/calendar/gui/e-cal-model-calendar.c	Fri Apr 18 09:12:26 2008
@@ -377,11 +377,33 @@
 		break;
 	}
 
-	if (e_cal_modify_object (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL)) {
+	if (e_cal_modify_object (comp_data->client, comp_data->icalcomp, mod, NULL)) {
 		if (itip_organizer_is_user (comp, comp_data->client) &&
-		    send_component_dialog (NULL, comp_data->client, comp, FALSE))
-			itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
+		    send_component_dialog (NULL, comp_data->client, comp, FALSE)) {
+			ECalComponent *send_comp = NULL;
+
+			if (mod == CALOBJ_MOD_ALL && e_cal_component_is_instance (comp)) {
+				/* Ensure we send the master object, not the instance only */
+				icalcomponent *icalcomp = NULL;
+				const char *uid = NULL;
+
+				e_cal_component_get_uid (comp, &uid);
+				if (e_cal_get_object (comp_data->client, uid, NULL, &icalcomp, NULL) && icalcomp) {
+					send_comp = e_cal_component_new ();
+					if (!e_cal_component_set_icalcomponent (send_comp, icalcomp)) {
+						icalcomponent_free (icalcomp);
+						g_object_unref (send_comp);
+						send_comp = NULL;
+					}
+				}
+			}
+
+			itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, send_comp ? send_comp : comp,
 					comp_data->client, NULL, NULL, NULL);
+
+			if (send_comp)
+				g_object_unref (send_comp);
+		}
 	} else {
 		g_warning (G_STRLOC ": Could not modify the object!");
 

Modified: trunk/calendar/gui/e-calendar-view.c
==============================================================================
--- trunk/calendar/gui/e-calendar-view.c	(original)
+++ trunk/calendar/gui/e-calendar-view.c	Fri Apr 18 09:12:26 2008
@@ -2052,8 +2052,30 @@
 {
 	if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) {
 		if ((itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) &&
-		    send_component_dialog (toplevel, client, comp, new))
-			itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, client, NULL, NULL, NULL);
+		    send_component_dialog (toplevel, client, comp, new)) {
+			ECalComponent *send_comp = NULL;
+
+			if (mod == CALOBJ_MOD_ALL && e_cal_component_is_instance (comp)) {
+				/* Ensure we send the master object, not the instance only */
+				icalcomponent *icalcomp = NULL;
+				const char *uid = NULL;
+
+				e_cal_component_get_uid (comp, &uid);
+				if (e_cal_get_object (client, uid, NULL, &icalcomp, NULL) && icalcomp) {
+					send_comp = e_cal_component_new ();
+					if (!e_cal_component_set_icalcomponent (send_comp, icalcomp)) {
+						icalcomponent_free (icalcomp);
+						g_object_unref (send_comp);
+						send_comp = NULL;
+					}
+				}
+			}
+
+			itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, send_comp ? send_comp : comp, client, NULL, NULL, NULL);
+
+			if (send_comp)
+				g_object_unref (send_comp);
+		}
 	} else {
 		g_message (G_STRLOC ": Could not update the object!");
 	}



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