aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-08-03 05:19:55 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-08-03 23:40:13 +0800
commit6055337bbac4e516c2c5b41b965fbffce6cf69c6 (patch)
treea670305a21361b9dba6bd13e7ccc30c4755f880f /shell
parentaa8b7b68fc3ac2f877cde7afcac096477f3b3e56 (diff)
downloadgsoc2013-evolution-6055337bbac4e516c2c5b41b965fbffce6cf69c6.tar
gsoc2013-evolution-6055337bbac4e516c2c5b41b965fbffce6cf69c6.tar.gz
gsoc2013-evolution-6055337bbac4e516c2c5b41b965fbffce6cf69c6.tar.bz2
gsoc2013-evolution-6055337bbac4e516c2c5b41b965fbffce6cf69c6.tar.lz
gsoc2013-evolution-6055337bbac4e516c2c5b41b965fbffce6cf69c6.tar.xz
gsoc2013-evolution-6055337bbac4e516c2c5b41b965fbffce6cf69c6.tar.zst
gsoc2013-evolution-6055337bbac4e516c2c5b41b965fbffce6cf69c6.zip
Add e_shell_view_remote_delete_source().
Convenience function wraps e_source_remote_delete() but handles user-facing activity and error display.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-view.c33
-rw-r--r--shell/e-shell-view.h3
2 files changed, 36 insertions, 0 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 06e99a8270..a8e47d4691 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1954,3 +1954,36 @@ e_shell_view_remove_source (EShellView *shell_view,
e_shell_backend_add_activity (shell_backend, activity);
}
+/**
+ * e_shell_view_remote_delete_source:
+ * @shell_view: an #EShellView
+ * @source: an #ESource
+ *
+ * Deletes the resource represented by @source from a remote server.
+ * The @source must be #ESource:remote-deletable. This will also delete
+ * the key file for @source and broadcast its removal to all clients,
+ * similar to e_shell_view_remove_source().
+ *
+ * This function does not block; @shell_view will dispatch the operation
+ * asynchronously and handle any errors.
+ **/
+void
+e_shell_view_remote_delete_source (EShellView *shell_view,
+ ESource *source)
+{
+ EActivity *activity;
+ EAlertSink *alert_sink;
+ EShellBackend *shell_backend;
+ EShellContent *shell_content;
+
+ g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+ g_return_if_fail (E_IS_SOURCE (source));
+
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+
+ alert_sink = E_ALERT_SINK (shell_content);
+ activity = e_source_util_remote_delete (source, alert_sink);
+ e_shell_backend_add_activity (shell_backend, activity);
+}
+
diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h
index 726777f2d4..84b3c69314 100644
--- a/shell/e-shell-view.h
+++ b/shell/e-shell-view.h
@@ -234,6 +234,9 @@ void e_shell_view_write_source (EShellView *shell_view,
ESource *source);
void e_shell_view_remove_source (EShellView *shell_view,
ESource *source);
+void e_shell_view_remote_delete_source
+ (EShellView *shell_view,
+ ESource *source);
G_END_DECLS