icera: port modem_time_check_support to use GTask
This commit is contained in:

committed by
Aleksander Morgado

parent
18a55f6940
commit
b7bfba3e54
@@ -1751,11 +1751,7 @@ modem_time_check_support_finish (MMIfaceModemTime *self,
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
/* We assume Icera devices always support *TLTS, since they appear
|
return g_task_propagate_boolean (G_TASK (res), error);
|
||||||
* to return ERROR if the modem is not powered up, and thus we cannot
|
|
||||||
* check for *TLTS support during modem initialization.
|
|
||||||
*/
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1763,15 +1759,16 @@ modem_time_check_support (MMIfaceModemTime *self,
|
|||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GSimpleAsyncResult *result;
|
GTask *task;
|
||||||
|
|
||||||
result = g_simple_async_result_new (G_OBJECT (self),
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
callback,
|
|
||||||
user_data,
|
|
||||||
modem_time_check_support);
|
|
||||||
|
|
||||||
g_simple_async_result_complete_in_idle (result);
|
/* We assume Icera devices always support *TLTS, since they appear
|
||||||
g_object_unref (result);
|
* to return ERROR if the modem is not powered up, and thus we cannot
|
||||||
|
* check for *TLTS support during modem initialization.
|
||||||
|
*/
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
Reference in New Issue
Block a user