aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-activity.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-activity.c')
-rw-r--r--e-util/e-activity.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/e-util/e-activity.c b/e-util/e-activity.c
index e4c121308b..87b84495db 100644
--- a/e-util/e-activity.c
+++ b/e-util/e-activity.c
@@ -383,6 +383,33 @@ e_activity_new (void)
}
/**
+ * e_activity_cancel:
+ * @activity: an #EActivity
+ *
+ * Convenience function cancels @activity's #EActivity:cancellable.
+ *
+ * <para>
+ * <note>
+ * This function will not set @activity's #EActivity:state to
+ * @E_ACTIVITY_CANCELLED. It merely requests that the associated
+ * operation be cancelled. Only after the operation finishes with
+ * a @G_IO_ERROR_CANCELLED should the @activity's #EActivity:state
+ * be changed (see e_activity_handle_cancellation()). During this
+ * interim period e_activity_describe() will indicate the activity
+ * is "cancelling".
+ * </note>
+ * </para>
+ **/
+void
+e_activity_cancel (EActivity *activity)
+{
+ g_return_if_fail (E_IS_ACTIVITY (activity));
+
+ /* This function handles NULL gracefully. */
+ g_cancellable_cancel (activity->priv->cancellable);
+}
+
+/**
* e_activity_describe:
* @activity: an #EActivity
*