[evolution] Bug #670967 - Moving event in offline doesn't delete event from original calendar



commit 62c2c75d78ec5912fb8b5d05ac9eb563922f6173
Author: Vibha Yadav <yvibha suse com>
Date:   Wed Apr 4 14:59:36 2012 +0530

    Bug #670967 - Moving event in offline doesn't delete event from original calendar
    
    check for online state and if not verify source isn't a local calendar and
    operation is move or destination isn't a local calendar.

 modules/calendar/e-cal-shell-view-private.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index 37cdc07..818ee30 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -858,6 +858,9 @@ e_cal_shell_view_transfer_item_to (ECalShellView *cal_shell_view,
 	icalcomponent *icalcomp_event;
 	gboolean success;
 	const gchar *uid;
+	EShell *shell;
+	EShellContent *shell_content;	
+	gboolean is_src_local_cal, is_dest_local_cal;
 
 	/* XXX This function should be split up into
 	 *     smaller, more understandable pieces. */
@@ -869,6 +872,23 @@ e_cal_shell_view_transfer_item_to (ECalShellView *cal_shell_view,
 	if (!is_comp_data_valid (event))
 		return;
 
+	/*If not online and
+	 * source isn't a local calendar and operation is move or destination isn't a local calendar,
+	 *  then Return*/
+	is_src_local_cal = g_str_has_prefix (e_client_get_uri(E_CLIENT (event->comp_data->client)), "local:");
+	is_dest_local_cal = g_str_has_prefix (e_client_get_uri(E_CLIENT (destination_client)), "local:");
+
+	shell = e_shell_get_default ();
+	shell_content = e_shell_view_get_shell_content(E_SHELL_VIEW (cal_shell_view));
+	if(!e_shell_get_online(shell) && ((!is_src_local_cal && remove) || !is_dest_local_cal))
+	{
+		e_alert_submit (
+			E_ALERT_SINK (shell_content),
+		       	"calendar:online-operation",
+			NULL);
+		return;
+	}
+
 	icalcomp_event = event->comp_data->icalcomp;
 	uid = icalcomponent_get_uid (icalcomp_event);
 



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