mirror of
https://gitlab.freedesktop.org/libfprint/fprintd.git
synced 2025-12-28 19:10:10 +01:00
Kill ListEnrolledFingersFromStorage
Last FromStorage variant killed, we need to make sure all the functions now use the storage functions internally, otherwise we won't be able to load from the place we save.
This commit is contained in:
parent
148b6fc676
commit
b1b5e2b495
3 changed files with 8 additions and 52 deletions
45
src/device.c
45
src/device.c
|
|
@ -35,8 +35,6 @@ static void fprint_device_claim(FprintDevice *rdev,
|
|||
DBusGMethodInvocation *context);
|
||||
static void fprint_device_release(FprintDevice *rdev,
|
||||
DBusGMethodInvocation *context);
|
||||
static void fprint_device_list_enrolled_fingers(FprintDevice *rdev,
|
||||
DBusGMethodInvocation *context);
|
||||
static void fprint_device_unload_print_data(FprintDevice *rdev,
|
||||
guint32 print_id, DBusGMethodInvocation *context);
|
||||
static void fprint_device_verify_start(FprintDevice *rdev,
|
||||
|
|
@ -49,8 +47,8 @@ static void fprint_device_enroll_stop(FprintDevice *rdev,
|
|||
DBusGMethodInvocation *context);
|
||||
static gboolean fprint_device_set_storage_type(FprintDevice *rdev,
|
||||
gint type);
|
||||
static void fprint_device_list_enrolled_fingers_from_storage(FprintDevice *rdev,
|
||||
gchar *username, DBusGMethodInvocation *context);
|
||||
static void fprint_device_list_enrolled_fingers(FprintDevice *rdev,
|
||||
DBusGMethodInvocation *context);
|
||||
static void fprint_device_load_print_data(FprintDevice *rdev,
|
||||
guint32 finger_num, DBusGMethodInvocation *context);
|
||||
|
||||
|
|
@ -322,40 +320,6 @@ static void fprint_device_release(FprintDevice *rdev,
|
|||
fp_async_dev_close(priv->dev, dev_close_cb, rdev);
|
||||
}
|
||||
|
||||
static void fprint_device_list_enrolled_fingers(FprintDevice *rdev,
|
||||
DBusGMethodInvocation *context)
|
||||
{
|
||||
FprintDevicePrivate *priv = DEVICE_GET_PRIVATE(rdev);
|
||||
struct fp_dscv_print **prints;
|
||||
struct fp_dscv_print **print;
|
||||
GArray *ret;
|
||||
GError *error = NULL;
|
||||
|
||||
if (_fprint_device_check_claimed(rdev, context, &error) == FALSE) {
|
||||
dbus_g_method_return_error (context, error);
|
||||
return;
|
||||
}
|
||||
|
||||
prints = fp_discover_prints();
|
||||
if (!prints) {
|
||||
g_set_error(&error, FPRINT_ERROR, FPRINT_ERROR_DISCOVER_PRINTS,
|
||||
"Failed to discover prints");
|
||||
dbus_g_method_return_error(context, error);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = g_array_new(FALSE, FALSE, sizeof(int));
|
||||
for (print = prints; *print; print++)
|
||||
if (fp_dev_supports_dscv_print(priv->dev, *print)) {
|
||||
int finger = fp_dscv_print_get_finger(*print);
|
||||
ret = g_array_append_val(ret, finger);
|
||||
}
|
||||
|
||||
fp_dscv_prints_free(prints);
|
||||
|
||||
dbus_g_method_return(context, ret);
|
||||
}
|
||||
|
||||
static void fprint_device_unload_print_data(FprintDevice *rdev,
|
||||
guint32 print_id, DBusGMethodInvocation *context)
|
||||
{
|
||||
|
|
@ -562,11 +526,12 @@ static gboolean fprint_device_set_storage_type(FprintDevice *rdev,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void fprint_device_list_enrolled_fingers_from_storage(FprintDevice *rdev,
|
||||
gchar *username, DBusGMethodInvocation *context)
|
||||
static void fprint_device_list_enrolled_fingers(FprintDevice *rdev,
|
||||
DBusGMethodInvocation *context)
|
||||
{
|
||||
FprintDevicePrivate *priv = DEVICE_GET_PRIVATE(rdev);
|
||||
GError *error = NULL;
|
||||
const char *username = "hadess"; //FIXME
|
||||
GSList *prints;
|
||||
GSList *item;
|
||||
GArray *ret;
|
||||
|
|
|
|||
|
|
@ -60,12 +60,6 @@
|
|||
<annotation name="org.freedesktop.DBus.GLib.Async" value="" />
|
||||
</method>
|
||||
|
||||
<method name="ListEnrolledFingersFromStorage">
|
||||
<arg type="s" name="username" direction="in" />
|
||||
<arg type="au" name="enrolled_fingers" direction="out" />
|
||||
<annotation name="org.freedesktop.DBus.GLib.Async" value="" />
|
||||
</method>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ static DBusGProxy *open_device(void)
|
|||
return dev;
|
||||
}
|
||||
|
||||
static guint32 find_finger(DBusGProxy *dev, const char *username)
|
||||
static guint32 find_finger(DBusGProxy *dev)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GArray *fingers;
|
||||
|
|
@ -154,7 +154,7 @@ static guint32 find_finger(DBusGProxy *dev, const char *username)
|
|||
int fingernum;
|
||||
guint32 print_id;
|
||||
|
||||
if (!net_reactivated_Fprint_Device_list_enrolled_fingers_from_storage(dev, username, &fingers, &error))
|
||||
if (!net_reactivated_Fprint_Device_list_enrolled_fingers(dev, &fingers, &error))
|
||||
g_error("ListEnrolledFingers failed: %s", error->message);
|
||||
|
||||
if (fingers->len == 0) {
|
||||
|
|
@ -226,16 +226,13 @@ int main(int argc, char **argv)
|
|||
GMainLoop *loop;
|
||||
DBusGProxy *dev;
|
||||
guint32 print_id;
|
||||
const char *username;
|
||||
|
||||
g_type_init();
|
||||
loop = g_main_loop_new(NULL, FALSE);
|
||||
create_manager();
|
||||
|
||||
username = g_get_user_name ();
|
||||
|
||||
dev = open_device();
|
||||
print_id = find_finger(dev, username);
|
||||
print_id = find_finger(dev);
|
||||
do_verify(dev, print_id);
|
||||
unload_print(dev, print_id);
|
||||
release_device(dev);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue