device: Move fp_device_clear_storage_sync into _sync block

Just so that all the _sync functions are together.
This commit is contained in:
Benjamin Berg 2021-04-30 15:02:19 +02:00 committed by Benjamin Berg
parent 439223cac3
commit 9c0cd3fb23

View file

@ -1766,6 +1766,34 @@ fp_device_list_prints_sync (FpDevice *device,
return fp_device_list_prints_finish (device, task, error); return fp_device_list_prints_finish (device, task, error);
} }
/**
* fp_device_clear_storage_sync:
* @device: a #FpDevice
* @cancellable: (nullable): a #GCancellable, or %NULL
* @error: Return location for errors, or %NULL to ignore
*
* Clear sensor storage.
*
* Returns: (type void): %FALSE on error, %TRUE otherwise
*/
gboolean
fp_device_clear_storage_sync (FpDevice *device,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GAsyncResult) task = NULL;
g_return_val_if_fail (FP_IS_DEVICE (device), FALSE);
fp_device_clear_storage (device,
cancellable,
async_result_ready, &task);
while (!task)
g_main_context_iteration (NULL, TRUE);
return fp_device_clear_storage_finish (device, task, error);
}
/** /**
* fp_device_get_features: * fp_device_get_features:
* @device: a #FpDevice * @device: a #FpDevice
@ -1803,31 +1831,3 @@ fp_device_has_feature (FpDevice *device,
return (fp_device_get_features (device) & feature) == feature; return (fp_device_get_features (device) & feature) == feature;
} }
/**
* fp_device_clear_storage_sync:
* @device: a #FpDevice
* @cancellable: (nullable): a #GCancellable, or %NULL
* @error: Return location for errors, or %NULL to ignore
*
* Clear sensor storage.
*
* Returns: (type void): %FALSE on error, %TRUE otherwise
*/
gboolean
fp_device_clear_storage_sync (FpDevice *device,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GAsyncResult) task = NULL;
g_return_val_if_fail (FP_IS_DEVICE (device), FALSE);
fp_device_clear_storage (device,
cancellable,
async_result_ready, &task);
while (!task)
g_main_context_iteration (NULL, TRUE);
return fp_device_clear_storage_finish (device, task, error);
}