From ba60533f71a6ff95b8bc7225ea537ef220666fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 11 Feb 2020 23:34:12 +0100 Subject: [PATCH] device: Remove unused disconnected flag We were saving the state of a disconnected device because we used a workaround to figure it out, but now libfprint would provide us a proper GError in such case, and so we'd handle it without the need of saving the state, given it's never used anyways. --- src/device.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/device.c b/src/device.c index 8a3f676..7aab3d7 100644 --- a/src/device.c +++ b/src/device.c @@ -112,8 +112,6 @@ typedef struct { FprintDeviceAction current_action; GCancellable *current_cancellable; DBusGMethodInvocation *current_cancel_context; - /* Whether the device was disconnected */ - gboolean disconnected; } FprintDevicePrivate; G_DEFINE_TYPE_WITH_CODE(FprintDevice, fprint_device, G_TYPE_OBJECT, G_ADD_PRIVATE (FprintDevice)); @@ -390,14 +388,6 @@ enroll_result_to_name (gboolean completed, gboolean enrolled, GError *error) } } -static void -set_disconnected (FprintDevicePrivate *priv, const char *res) -{ - if (g_str_equal (res, "enroll-disconnected") || - g_str_equal (res, "verify-disconnected")) - priv->disconnected = TRUE; -} - static gboolean _fprint_device_check_claimed (FprintDevice *rdev, DBusGMethodInvocation *context, @@ -748,8 +738,6 @@ static void verify_cb(FpDevice *dev, GAsyncResult *res, void *user_data) g_debug("verify_cb: result %s", name); - set_disconnected (priv, name); - /* Automatically restart the operation for retry failures */ if (error && error->domain == FP_DEVICE_RETRY) { g_signal_emit(rdev, signals[SIGNAL_VERIFY_STATUS], 0, name, FALSE); @@ -796,8 +784,6 @@ static void identify_cb(FpDevice *dev, GAsyncResult *res, void *user_data) g_debug("identify_cb: result %s", name); - set_disconnected (priv, name); - /* Automatically restart the operation for retry failures */ if (error && error->domain == FP_DEVICE_RETRY) { g_signal_emit (rdev, signals[SIGNAL_VERIFY_STATUS], 0, name, FALSE); @@ -1127,8 +1113,6 @@ static void enroll_cb(FpDevice *dev, GAsyncResult *res, void *user_data) name = "enroll-failed"; } - set_disconnected (priv, name); - g_signal_emit(rdev, signals[SIGNAL_ENROLL_STATUS], 0, name, TRUE); if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))