diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-04-25 06:26:43 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-04-25 23:42:04 +0800 |
commit | 8b245838de22f470e867b28631240a018a0bc36b (patch) | |
tree | 23576c4320b45c8110640227b4a3c3545377cfeb /e-util/e-activity.c | |
parent | d0a0a397987684334c5fd41b364218782bc9bcfd (diff) | |
download | gsoc2013-evolution-8b245838de22f470e867b28631240a018a0bc36b.tar gsoc2013-evolution-8b245838de22f470e867b28631240a018a0bc36b.tar.gz gsoc2013-evolution-8b245838de22f470e867b28631240a018a0bc36b.tar.bz2 gsoc2013-evolution-8b245838de22f470e867b28631240a018a0bc36b.tar.lz gsoc2013-evolution-8b245838de22f470e867b28631240a018a0bc36b.tar.xz gsoc2013-evolution-8b245838de22f470e867b28631240a018a0bc36b.tar.zst gsoc2013-evolution-8b245838de22f470e867b28631240a018a0bc36b.zip |
Add e_activity_cancel().
Convenience function cancels the activity's GCancellable.
Diffstat (limited to 'e-util/e-activity.c')
-rw-r--r-- | e-util/e-activity.c | 27 |
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 * |