mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-09 04:13:33 +02:00
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.
This commit is contained in:
committed by
Bastien Nocera
parent
fcd2d65490
commit
ba60533f71
16
src/device.c
16
src/device.c
@ -112,8 +112,6 @@ typedef struct {
|
|||||||
FprintDeviceAction current_action;
|
FprintDeviceAction current_action;
|
||||||
GCancellable *current_cancellable;
|
GCancellable *current_cancellable;
|
||||||
DBusGMethodInvocation *current_cancel_context;
|
DBusGMethodInvocation *current_cancel_context;
|
||||||
/* Whether the device was disconnected */
|
|
||||||
gboolean disconnected;
|
|
||||||
} FprintDevicePrivate;
|
} FprintDevicePrivate;
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE(FprintDevice, fprint_device, G_TYPE_OBJECT, G_ADD_PRIVATE (FprintDevice));
|
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
|
static gboolean
|
||||||
_fprint_device_check_claimed (FprintDevice *rdev,
|
_fprint_device_check_claimed (FprintDevice *rdev,
|
||||||
DBusGMethodInvocation *context,
|
DBusGMethodInvocation *context,
|
||||||
@ -748,8 +738,6 @@ static void verify_cb(FpDevice *dev, GAsyncResult *res, void *user_data)
|
|||||||
|
|
||||||
g_debug("verify_cb: result %s", name);
|
g_debug("verify_cb: result %s", name);
|
||||||
|
|
||||||
set_disconnected (priv, name);
|
|
||||||
|
|
||||||
/* Automatically restart the operation for retry failures */
|
/* Automatically restart the operation for retry failures */
|
||||||
if (error && error->domain == FP_DEVICE_RETRY) {
|
if (error && error->domain == FP_DEVICE_RETRY) {
|
||||||
g_signal_emit(rdev, signals[SIGNAL_VERIFY_STATUS], 0, name, FALSE);
|
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);
|
g_debug("identify_cb: result %s", name);
|
||||||
|
|
||||||
set_disconnected (priv, name);
|
|
||||||
|
|
||||||
/* Automatically restart the operation for retry failures */
|
/* Automatically restart the operation for retry failures */
|
||||||
if (error && error->domain == FP_DEVICE_RETRY) {
|
if (error && error->domain == FP_DEVICE_RETRY) {
|
||||||
g_signal_emit (rdev, signals[SIGNAL_VERIFY_STATUS], 0, name, FALSE);
|
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";
|
name = "enroll-failed";
|
||||||
}
|
}
|
||||||
|
|
||||||
set_disconnected (priv, name);
|
|
||||||
|
|
||||||
g_signal_emit(rdev, signals[SIGNAL_ENROLL_STATUS], 0, name, TRUE);
|
g_signal_emit(rdev, signals[SIGNAL_ENROLL_STATUS], 0, name, TRUE);
|
||||||
|
|
||||||
if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
|
|||||||
Reference in New Issue
Block a user