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:
Marco Trevisan (Treviño)
2019-11-20 14:36:57 +01:00
committed by Benjamin Berg
parent ab804f7f49
commit 39e3e2b794
5 changed files with 17 additions and 37 deletions

View File

@@ -40,18 +40,6 @@ verify_data_free (VerifyData *verify_data)
}
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VerifyData, verify_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)
{