mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
gio: deprecate GSimpleAsyncResult
GTask has been around for a long time now, everything in GLib is using it, and the run-in-thread deadlock problems should be fixed now. https://bugzilla.gnome.org/show_bug.cgi?id=661767
This commit is contained in:
@@ -202,6 +202,8 @@
|
||||
* ]|
|
||||
*/
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface);
|
||||
|
||||
struct _GSimpleAsyncResult
|
||||
@@ -305,6 +307,8 @@ g_simple_async_result_init (GSimpleAsyncResult *simple)
|
||||
* this function returns.
|
||||
*
|
||||
* Returns: a #GSimpleAsyncResult.
|
||||
*
|
||||
* Deprecated: 2.46: Use g_task_new() instead.
|
||||
**/
|
||||
GSimpleAsyncResult *
|
||||
g_simple_async_result_new (GObject *source_object,
|
||||
@@ -338,6 +342,8 @@ g_simple_async_result_new (GObject *source_object,
|
||||
* Creates a #GSimpleAsyncResult from an error condition.
|
||||
*
|
||||
* Returns: a #GSimpleAsyncResult.
|
||||
*
|
||||
* Deprecated: 2.46: Use g_task_new() and g_task_return_error() instead.
|
||||
**/
|
||||
GSimpleAsyncResult *
|
||||
g_simple_async_result_new_from_error (GObject *source_object,
|
||||
@@ -370,6 +376,8 @@ g_simple_async_result_new_from_error (GObject *source_object,
|
||||
* Returns: a #GSimpleAsyncResult
|
||||
*
|
||||
* Since: 2.28
|
||||
*
|
||||
* Deprecated: 2.46: Use g_task_new() and g_task_return_error() instead.
|
||||
**/
|
||||
GSimpleAsyncResult *
|
||||
g_simple_async_result_new_take_error (GObject *source_object,
|
||||
@@ -402,6 +410,8 @@ g_simple_async_result_new_take_error (GObject *source_object,
|
||||
* Creates a new #GSimpleAsyncResult with a set error.
|
||||
*
|
||||
* Returns: a #GSimpleAsyncResult.
|
||||
*
|
||||
* Deprecated: 2.46: Use g_task_new() and g_task_return_new_error() instead.
|
||||
**/
|
||||
GSimpleAsyncResult *
|
||||
g_simple_async_result_new_error (GObject *source_object,
|
||||
@@ -470,6 +480,8 @@ g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface)
|
||||
* This function has nothing to do with
|
||||
* g_simple_async_result_set_check_cancellable(). It only refers to the
|
||||
* #GCancellable passed to g_simple_async_result_run_in_thread().
|
||||
*
|
||||
* Deprecated: 2.46
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_set_handle_cancellation (GSimpleAsyncResult *simple,
|
||||
@@ -486,6 +498,8 @@ g_simple_async_result_set_handle_cancellation (GSimpleAsyncResult *simple,
|
||||
* Gets the source tag for the #GSimpleAsyncResult.
|
||||
*
|
||||
* Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
|
||||
*
|
||||
* Deprecated: 2.46. Use #GTask and g_task_get_source_tag() instead.
|
||||
**/
|
||||
gpointer
|
||||
g_simple_async_result_get_source_tag (GSimpleAsyncResult *simple)
|
||||
@@ -507,6 +521,8 @@ g_simple_async_result_get_source_tag (GSimpleAsyncResult *simple)
|
||||
* function will return %TRUE with @dest set appropriately.
|
||||
*
|
||||
* Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask instead.
|
||||
**/
|
||||
gboolean
|
||||
g_simple_async_result_propagate_error (GSimpleAsyncResult *simple,
|
||||
@@ -534,6 +550,8 @@ g_simple_async_result_propagate_error (GSimpleAsyncResult *simple,
|
||||
* @destroy_op_res: a #GDestroyNotify function.
|
||||
*
|
||||
* Sets the operation result within the asynchronous result to a pointer.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_return_pointer() instead.
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_set_op_res_gpointer (GSimpleAsyncResult *simple,
|
||||
@@ -554,6 +572,8 @@ g_simple_async_result_set_op_res_gpointer (GSimpleAsyncResult *simple,
|
||||
* Gets a pointer result as returned by the asynchronous function.
|
||||
*
|
||||
* Returns: a pointer from the result.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_propagate_pointer() instead.
|
||||
**/
|
||||
gpointer
|
||||
g_simple_async_result_get_op_res_gpointer (GSimpleAsyncResult *simple)
|
||||
@@ -569,6 +589,8 @@ g_simple_async_result_get_op_res_gpointer (GSimpleAsyncResult *simple)
|
||||
*
|
||||
* Sets the operation result within the asynchronous result to
|
||||
* the given @op_res.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_return_int() instead.
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_set_op_res_gssize (GSimpleAsyncResult *simple,
|
||||
@@ -586,6 +608,8 @@ g_simple_async_result_set_op_res_gssize (GSimpleAsyncResult *simple,
|
||||
* Gets a gssize from the asynchronous result.
|
||||
*
|
||||
* Returns: a gssize returned from the asynchronous function.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_propagate_int() instead.
|
||||
**/
|
||||
gssize
|
||||
g_simple_async_result_get_op_res_gssize (GSimpleAsyncResult *simple)
|
||||
@@ -600,6 +624,8 @@ g_simple_async_result_get_op_res_gssize (GSimpleAsyncResult *simple)
|
||||
* @op_res: a #gboolean.
|
||||
*
|
||||
* Sets the operation result to a boolean within the asynchronous result.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_return_boolean() instead.
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_set_op_res_gboolean (GSimpleAsyncResult *simple,
|
||||
@@ -618,6 +644,8 @@ g_simple_async_result_set_op_res_gboolean (GSimpleAsyncResult *simple,
|
||||
*
|
||||
* Returns: %TRUE if the operation's result was %TRUE, %FALSE
|
||||
* if the operation's result was %FALSE.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_propagate_boolean() instead.
|
||||
**/
|
||||
gboolean
|
||||
g_simple_async_result_get_op_res_gboolean (GSimpleAsyncResult *simple)
|
||||
@@ -632,6 +660,8 @@ g_simple_async_result_get_op_res_gboolean (GSimpleAsyncResult *simple)
|
||||
* @error: #GError.
|
||||
*
|
||||
* Sets the result from a #GError.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_return_error() instead.
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_set_from_error (GSimpleAsyncResult *simple,
|
||||
@@ -655,6 +685,8 @@ g_simple_async_result_set_from_error (GSimpleAsyncResult *simple,
|
||||
* of @error, so the caller does not need to free it any more.
|
||||
*
|
||||
* Since: 2.28
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_return_error() instead.
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_take_error (GSimpleAsyncResult *simple,
|
||||
@@ -679,6 +711,8 @@ g_simple_async_result_take_error (GSimpleAsyncResult *simple,
|
||||
*
|
||||
* Sets an error within the asynchronous result without a #GError.
|
||||
* Unless writing a binding, see g_simple_async_result_set_error().
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_return_error() instead.
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_set_error_va (GSimpleAsyncResult *simple,
|
||||
@@ -706,6 +740,8 @@ g_simple_async_result_set_error_va (GSimpleAsyncResult *simple,
|
||||
* @...: a list of variables to fill in @format.
|
||||
*
|
||||
* Sets an error within the asynchronous result without a #GError.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_return_new_error() instead.
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_set_error (GSimpleAsyncResult *simple,
|
||||
@@ -736,6 +772,8 @@ g_simple_async_result_set_error (GSimpleAsyncResult *simple,
|
||||
*
|
||||
* Calling this function takes a reference to @simple for as long as
|
||||
* is needed to complete the call.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask instead.
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_complete (GSimpleAsyncResult *simple)
|
||||
@@ -788,6 +826,8 @@ complete_in_idle_cb (gpointer data)
|
||||
*
|
||||
* Calling this function takes a reference to @simple for as long as
|
||||
* is needed to complete the call.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask instead.
|
||||
*/
|
||||
void
|
||||
g_simple_async_result_complete_in_idle (GSimpleAsyncResult *simple)
|
||||
@@ -883,6 +923,8 @@ run_in_thread (GIOSchedulerJob *job,
|
||||
*
|
||||
* Calling this function takes a reference to @simple for as long as
|
||||
* is needed to run the job and report its completion.
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_run_in_thread() instead.
|
||||
*/
|
||||
void
|
||||
g_simple_async_result_run_in_thread (GSimpleAsyncResult *simple,
|
||||
@@ -928,6 +970,8 @@ g_simple_async_result_run_in_thread (GSimpleAsyncResult *simple,
|
||||
* Returns: #TRUE if all checks passed or #FALSE if any failed.
|
||||
*
|
||||
* Since: 2.20
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask and g_task_is_valid() instead.
|
||||
**/
|
||||
gboolean
|
||||
g_simple_async_result_is_valid (GAsyncResult *result,
|
||||
@@ -970,6 +1014,8 @@ g_simple_async_result_is_valid (GAsyncResult *result,
|
||||
* Reports an error in an asynchronous function in an idle function by
|
||||
* directly setting the contents of the #GAsyncResult with the given error
|
||||
* information.
|
||||
*
|
||||
* Deprecated: 2.46: Use g_task_report_error().
|
||||
**/
|
||||
void
|
||||
g_simple_async_report_error_in_idle (GObject *object,
|
||||
@@ -1008,6 +1054,8 @@ g_simple_async_report_error_in_idle (GObject *object,
|
||||
* Reports an error in an idle function. Similar to
|
||||
* g_simple_async_report_error_in_idle(), but takes a #GError rather
|
||||
* than building a new one.
|
||||
*
|
||||
* Deprecated: 2.46: Use g_task_report_error().
|
||||
**/
|
||||
void
|
||||
g_simple_async_report_gerror_in_idle (GObject *object,
|
||||
@@ -1040,6 +1088,8 @@ g_simple_async_report_gerror_in_idle (GObject *object,
|
||||
* ownership of @error, so the caller does not have to free it any more.
|
||||
*
|
||||
* Since: 2.28
|
||||
*
|
||||
* Deprecated: 2.46: Use g_task_report_error().
|
||||
**/
|
||||
void
|
||||
g_simple_async_report_take_gerror_in_idle (GObject *object,
|
||||
@@ -1082,6 +1132,8 @@ g_simple_async_report_take_gerror_in_idle (GObject *object,
|
||||
* unrelated g_simple_async_result_set_handle_cancellation() function.
|
||||
*
|
||||
* Since: 2.32
|
||||
*
|
||||
* Deprecated: 2.46: Use #GTask instead.
|
||||
**/
|
||||
void
|
||||
g_simple_async_result_set_check_cancellable (GSimpleAsyncResult *simple,
|
||||
@@ -1094,3 +1146,5 @@ g_simple_async_result_set_check_cancellable (GSimpleAsyncResult *simple,
|
||||
if (check_cancellable)
|
||||
simple->check_cancellable = g_object_ref (check_cancellable);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
Reference in New Issue
Block a user