mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02: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:
30
src/device.c
30
src/device.c
@ -1425,7 +1425,6 @@ static gboolean
|
|||||||
fprint_device_verify_stop (FprintDBusDevice *dbus_dev,
|
fprint_device_verify_stop (FprintDBusDevice *dbus_dev,
|
||||||
GDBusMethodInvocation *invocation)
|
GDBusMethodInvocation *invocation)
|
||||||
{
|
{
|
||||||
g_autoptr(SessionData) session = NULL;
|
|
||||||
FprintDevice *rdev = FPRINT_DEVICE (dbus_dev);
|
FprintDevice *rdev = FPRINT_DEVICE (dbus_dev);
|
||||||
FprintDevicePrivate *priv = fprint_device_get_instance_private (rdev);
|
FprintDevicePrivate *priv = fprint_device_get_instance_private (rdev);
|
||||||
|
|
||||||
@ -1458,20 +1457,12 @@ fprint_device_verify_stop (FprintDBusDevice *dbus_dev,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
priv->current_cancel_invocation = invocation;
|
||||||
if (priv->current_cancellable)
|
if (priv->current_cancellable)
|
||||||
{
|
/* We return only when the action was cancelled */
|
||||||
/* We return only when the action was cancelled */
|
g_cancellable_cancel (priv->current_cancellable);
|
||||||
g_cancellable_cancel (priv->current_cancellable);
|
|
||||||
priv->current_cancel_invocation = invocation;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
stoppable_action_completed (rdev);
|
||||||
fprint_dbus_device_complete_verify_stop (dbus_dev, invocation);
|
|
||||||
priv->current_action = ACTION_NONE;
|
|
||||||
|
|
||||||
session = session_data_get (priv);
|
|
||||||
session->verify_status_reported = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1783,17 +1774,12 @@ fprint_device_enroll_stop (FprintDBusDevice *dbus_dev,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
priv->current_cancel_invocation = invocation;
|
||||||
if (priv->current_cancellable)
|
if (priv->current_cancellable)
|
||||||
{
|
/* We return only when the action was cancelled */
|
||||||
/* We return only when the action was cancelled */
|
g_cancellable_cancel (priv->current_cancellable);
|
||||||
g_cancellable_cancel (priv->current_cancellable);
|
|
||||||
priv->current_cancel_invocation = invocation;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
stoppable_action_completed (rdev);
|
||||||
fprint_dbus_device_complete_enroll_stop (dbus_dev, invocation);
|
|
||||||
priv->current_action = ACTION_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user