fpi-image-device: Allow overriding of enroll stages

This commit is contained in:
mincrmatt12 2020-08-06 03:41:31 -04:00
parent 9321791d0e
commit e95056aa86
2 changed files with 5 additions and 4 deletions

View file

@ -190,9 +190,7 @@ fp_image_device_constructed (GObject *obj)
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (self);
/* Set default values. */
fpi_device_set_nr_enroll_stages (FP_DEVICE (self), IMG_ENROLL_STAGES);
/* Set default threshold. */
priv->bz3_threshold = BOZORTH3_DEFAULT_THRESHOLD;
if (cls->bz3_threshold > 0)
priv->bz3_threshold = cls->bz3_threshold;
@ -210,6 +208,9 @@ fp_image_device_class_init (FpImageDeviceClass *klass)
object_class->get_property = fp_image_device_get_property;
object_class->constructed = fp_image_device_constructed;
/* Set default enroll stage count. */
fp_device_class->nr_enroll_stages = IMG_ENROLL_STAGES;
fp_device_class->open = fp_image_device_open;
fp_device_class->close = fp_image_device_close;
fp_device_class->enroll = fp_image_device_start_capture_action;

View file

@ -306,7 +306,7 @@ fpi_image_device_minutiae_detected (GObject *source_object, GAsyncResult *res, g
g_steal_pointer (&print), error);
/* Start another scan or deactivate. */
if (priv->enroll_stage == IMG_ENROLL_STAGES)
if (priv->enroll_stage == fp_device_get_nr_enroll_stages (device))
{
fp_image_device_maybe_complete_action (self, g_steal_pointer (&error));
fpi_image_device_deactivate (self, FALSE);