aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVibha Yadav <yvibha@suse.com>2012-04-04 17:29:36 +0800
committerVibha Yadav <yvibha@suse.com>2012-04-04 17:29:36 +0800
commit62c2c75d78ec5912fb8b5d05ac9eb563922f6173 (patch)
treee91e5064af0373c8a9c72b1aecd5a01594c7d5b0
parente4c0c101ee54034e1b3a9b1f11eb50d88acb9e66 (diff)
downloadgsoc2013-evolution-62c2c75d78ec5912fb8b5d05ac9eb563922f6173.tar.gz
gsoc2013-evolution-62c2c75d78ec5912fb8b5d05ac9eb563922f6173.tar.zst
gsoc2013-evolution-62c2c75d78ec5912fb8b5d05ac9eb563922f6173.zip
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.
-rw-r--r--modules/calendar/e-cal-shell-view-private.c20
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 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);