libnm-glib: fix GAsyncInitable implementations
If a class implements init_async, it should implement init_finish too, rather than assuming the default implementation will do the right thing (which it briefly didn't in glib 2.33).
This commit is contained in:
@@ -1566,6 +1566,17 @@ init_async (GAsyncInitable *initable, int io_priority,
|
|||||||
G_TYPE_INVALID);
|
G_TYPE_INVALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
init_finish (GAsyncInitable *initable, GAsyncResult *result, GError **error)
|
||||||
|
{
|
||||||
|
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
|
||||||
|
|
||||||
|
if (g_simple_async_result_propagate_error (simple, error))
|
||||||
|
return FALSE;
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dispose (GObject *object)
|
dispose (GObject *object)
|
||||||
{
|
{
|
||||||
@@ -1923,4 +1934,5 @@ nm_client_async_initable_iface_init (GAsyncInitableIface *iface)
|
|||||||
nm_client_parent_async_initable_iface = g_type_interface_peek_parent (iface);
|
nm_client_parent_async_initable_iface = g_type_interface_peek_parent (iface);
|
||||||
|
|
||||||
iface->init_async = init_async;
|
iface->init_async = init_async;
|
||||||
|
iface->init_finish = init_finish;
|
||||||
}
|
}
|
||||||
|
@@ -205,14 +205,10 @@ init_finish (GAsyncInitable *initable, GAsyncResult *result, GError **error)
|
|||||||
{
|
{
|
||||||
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
|
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
|
||||||
|
|
||||||
/* This is needed for now because of bug 667375; it can go away
|
|
||||||
* when we depend on glib >= 2.38
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (g_simple_async_result_propagate_error (simple, error))
|
if (g_simple_async_result_propagate_error (simple, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
else
|
||||||
return g_simple_async_result_get_op_res_gboolean (simple);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -448,6 +448,17 @@ init_async (GAsyncInitable *initable, int io_priority,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
init_finish (GAsyncInitable *initable, GAsyncResult *result, GError **error)
|
||||||
|
{
|
||||||
|
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
|
||||||
|
|
||||||
|
if (g_simple_async_result_propagate_error (simple, error))
|
||||||
|
return FALSE;
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_remote_connection_init (NMRemoteConnection *self)
|
nm_remote_connection_init (NMRemoteConnection *self)
|
||||||
{
|
{
|
||||||
@@ -563,4 +574,5 @@ static void
|
|||||||
nm_remote_connection_async_initable_iface_init (GAsyncInitableIface *iface)
|
nm_remote_connection_async_initable_iface_init (GAsyncInitableIface *iface)
|
||||||
{
|
{
|
||||||
iface->init_async = init_async;
|
iface->init_async = init_async;
|
||||||
|
iface->init_finish = init_finish;
|
||||||
}
|
}
|
||||||
|
@@ -1035,6 +1035,17 @@ init_async (GAsyncInitable *initable, int io_priority,
|
|||||||
G_TYPE_INVALID);
|
G_TYPE_INVALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
init_finish (GAsyncInitable *initable, GAsyncResult *result, GError **error)
|
||||||
|
{
|
||||||
|
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
|
||||||
|
|
||||||
|
if (g_simple_async_result_propagate_error (simple, error))
|
||||||
|
return FALSE;
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dispose (GObject *object)
|
dispose (GObject *object)
|
||||||
{
|
{
|
||||||
@@ -1198,4 +1209,5 @@ static void
|
|||||||
nm_remote_settings_async_initable_iface_init (GAsyncInitableIface *iface)
|
nm_remote_settings_async_initable_iface_init (GAsyncInitableIface *iface)
|
||||||
{
|
{
|
||||||
iface->init_async = init_async;
|
iface->init_async = init_async;
|
||||||
|
iface->init_finish = init_finish;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user