mirror of
https://gitlab.freedesktop.org/libfprint/fprintd.git
synced 2026-01-26 03:50:26 +01:00
device: Always use stoppable_action_completed to terminate actions
Avoid having repeated code for doing the same, nothing changes as before we were doing the same only in case we had not a cancellable set.
This commit is contained in:
parent
dbf01399ad
commit
56436fb8b1
1 changed files with 8 additions and 22 deletions
30
src/device.c
30
src/device.c
|
|
@ -1425,7 +1425,6 @@ static gboolean
|
|||
fprint_device_verify_stop (FprintDBusDevice *dbus_dev,
|
||||
GDBusMethodInvocation *invocation)
|
||||
{
|
||||
g_autoptr(SessionData) session = NULL;
|
||||
FprintDevice *rdev = FPRINT_DEVICE (dbus_dev);
|
||||
FprintDevicePrivate *priv = fprint_device_get_instance_private (rdev);
|
||||
|
||||
|
|
@ -1458,20 +1457,12 @@ fprint_device_verify_stop (FprintDBusDevice *dbus_dev,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
priv->current_cancel_invocation = invocation;
|
||||
if (priv->current_cancellable)
|
||||
{
|
||||
/* We return only when the action was cancelled */
|
||||
g_cancellable_cancel (priv->current_cancellable);
|
||||
priv->current_cancel_invocation = invocation;
|
||||
}
|
||||
/* We return only when the action was cancelled */
|
||||
g_cancellable_cancel (priv->current_cancellable);
|
||||
else
|
||||
{
|
||||
fprint_dbus_device_complete_verify_stop (dbus_dev, invocation);
|
||||
priv->current_action = ACTION_NONE;
|
||||
|
||||
session = session_data_get (priv);
|
||||
session->verify_status_reported = FALSE;
|
||||
}
|
||||
stoppable_action_completed (rdev);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1783,17 +1774,12 @@ fprint_device_enroll_stop (FprintDBusDevice *dbus_dev,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
priv->current_cancel_invocation = invocation;
|
||||
if (priv->current_cancellable)
|
||||
{
|
||||
/* We return only when the action was cancelled */
|
||||
g_cancellable_cancel (priv->current_cancellable);
|
||||
priv->current_cancel_invocation = invocation;
|
||||
}
|
||||
/* We return only when the action was cancelled */
|
||||
g_cancellable_cancel (priv->current_cancellable);
|
||||
else
|
||||
{
|
||||
fprint_dbus_device_complete_enroll_stop (dbus_dev, invocation);
|
||||
priv->current_action = ACTION_NONE;
|
||||
}
|
||||
stoppable_action_completed (rdev);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue