From b1b5e2b495ad86ab6da663c9f092c84b1044df6d Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 20 May 2008 11:11:25 +0100 Subject: [PATCH] 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. --- src/device.c | 45 +++++---------------------------------------- src/device.xml | 6 ------ tests/verify.c | 9 +++------ 3 files changed, 8 insertions(+), 52 deletions(-) diff --git a/src/device.c b/src/device.c index 03acf68..fe792c1 100644 --- a/src/device.c +++ b/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; diff --git a/src/device.xml b/src/device.xml index f82daac..6ef5801 100644 --- a/src/device.xml +++ b/src/device.xml @@ -60,12 +60,6 @@ - - - - - - diff --git a/tests/verify.c b/tests/verify.c index 2885e17..c2ff4db 100644 --- a/tests/verify.c +++ b/tests/verify.c @@ -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);