mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
examples: Move discover_device function to utilities
While there are various functions which similar usage in all the examples, I'd prefer to keep each example to be self-containing most of the things. However some clearly repeated action can be moved to a single codebase.
This commit is contained in:
committed by
Benjamin Berg
parent
ab804f7f49
commit
39e3e2b794
@@ -40,18 +40,6 @@ enroll_data_free (EnrollData *enroll_data)
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EnrollData, enroll_data_free)
|
||||
|
||||
FpDevice *discover_device (GPtrArray * devices)
|
||||
{
|
||||
FpDevice *dev;
|
||||
|
||||
if (!devices->len)
|
||||
return NULL;
|
||||
|
||||
dev = g_ptr_array_index (devices, 0);
|
||||
printf ("Found device claimed by %s driver\n", fp_device_get_driver (dev));
|
||||
return dev;
|
||||
}
|
||||
|
||||
static void
|
||||
on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user