diff --git a/lib/wp/session-item.c b/lib/wp/session-item.c index 9d4937c3753fcb37f56228f1f78bcaef4e369fc2..0a7d9f9e16c7529944955be7d4740c23f6707761 100644 --- a/lib/wp/session-item.c +++ b/lib/wp/session-item.c @@ -295,8 +295,8 @@ on_transition_completed (WpTransition * transition, GParamSpec * pspec, * that calls into #WpSessionItemClass.get_next_step() and * #WpSessionItemClass.execute_step() to advance. * - * You can use wp_transition_finish() in the @callback to figure out the - * result of this operation. + * You can use wp_session_item_activate_finish() in the @callback to figure out + * the result of this operation. * * Normally this function is called internally by the session; there is no need * to activate an item externally, except for unit testing purposes. @@ -326,6 +326,23 @@ wp_session_item_activate (WpSessionItem * self, wp_transition_advance (transition); } +/** + * wp_session_item_activate_finish: + * @self: the session item + * @res: the async operation result + * @error: (out) (optional): the error of the operation, if any + * + * Returns: %TRUE if the item is now activateed, %FALSE if there was an error + */ +gboolean +wp_session_item_activate_finish (WpSessionItem * self, GAsyncResult * res, + GError ** error) +{ + g_return_val_if_fail ( + g_async_result_is_tagged (res, wp_session_item_activate), FALSE); + return wp_transition_finish (res, error); +} + /** * wp_session_item_reset: (virtual reset) * @self: the session item diff --git a/lib/wp/session-item.h b/lib/wp/session-item.h index 9cf24d15eef00409bdaebb0038e39823b1227393..5446581e0f86af3d5266131beee56818280783a0 100644 --- a/lib/wp/session-item.h +++ b/lib/wp/session-item.h @@ -114,6 +114,10 @@ WP_API void wp_session_item_activate (WpSessionItem * self, GAsyncReadyCallback callback, gpointer callback_data); +WP_API +gboolean wp_session_item_activate_finish (WpSessionItem * self, + GAsyncResult * res, GError ** error); + WP_API void wp_session_item_reset (WpSessionItem * self);