aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);