From 62c2c75d78ec5912fb8b5d05ac9eb563922f6173 Mon Sep 17 00:00:00 2001 From: Vibha Yadav Date: Wed, 4 Apr 2012 14:59:36 +0530 Subject: 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 file changed, 20 insertions(+) (limited to 'modules/calendar') diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 37cdc0738b..818ee3047e 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); -- cgit v1.2.3