Skip to content
Snippets Groups Projects
Commit 763156e9 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

session-item: add an _activate_finish() method

parent dec86997
No related branches found
No related tags found
No related merge requests found
...@@ -295,8 +295,8 @@ on_transition_completed (WpTransition * transition, GParamSpec * pspec, ...@@ -295,8 +295,8 @@ on_transition_completed (WpTransition * transition, GParamSpec * pspec,
* that calls into #WpSessionItemClass.get_next_step() and * that calls into #WpSessionItemClass.get_next_step() and
* #WpSessionItemClass.execute_step() to advance. * #WpSessionItemClass.execute_step() to advance.
* *
* You can use wp_transition_finish() in the @callback to figure out the * You can use wp_session_item_activate_finish() in the @callback to figure out
* result of this operation. * the result of this operation.
* *
* Normally this function is called internally by the session; there is no need * Normally this function is called internally by the session; there is no need
* to activate an item externally, except for unit testing purposes. * to activate an item externally, except for unit testing purposes.
...@@ -326,6 +326,23 @@ wp_session_item_activate (WpSessionItem * self, ...@@ -326,6 +326,23 @@ wp_session_item_activate (WpSessionItem * self,
wp_transition_advance (transition); 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) * wp_session_item_reset: (virtual reset)
* @self: the session item * @self: the session item
......
...@@ -114,6 +114,10 @@ WP_API ...@@ -114,6 +114,10 @@ WP_API
void wp_session_item_activate (WpSessionItem * self, void wp_session_item_activate (WpSessionItem * self,
GAsyncReadyCallback callback, gpointer callback_data); GAsyncReadyCallback callback, gpointer callback_data);
WP_API
gboolean wp_session_item_activate_finish (WpSessionItem * self,
GAsyncResult * res, GError ** error);
WP_API WP_API
void wp_session_item_reset (WpSessionItem * self); void wp_session_item_reset (WpSessionItem * self);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment