Commit 93a6a9c2 authored by xiejiabo's avatar xiejiabo

fix: delete the unused code for `dev` and `in-use` property

parent c07a63da
Pipeline #197279 failed with stage
in 1 minute and 29 seconds
......@@ -117,9 +117,7 @@ typedef struct {
G_DEFINE_TYPE_WITH_CODE(FprintDevice, fprint_device, G_TYPE_OBJECT, G_ADD_PRIVATE (FprintDevice));
enum fprint_device_properties {
FPRINT_DEVICE_CONSTRUCT_DEV = 1,
FPRINT_DEVICE_IN_USE,
FPRINT_DEVICE_NAME,
FPRINT_DEVICE_NAME = 1,
FPRINT_DEVICE_NUM_ENROLL,
FPRINT_DEVICE_SCAN_TYPE
};
......@@ -158,17 +156,7 @@ static void fprint_device_finalize(GObject *object)
static void fprint_device_set_property(GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec)
{
FprintDevice *self = (FprintDevice *) object;
FprintDevicePrivate *priv = fprint_device_get_instance_private(self);
switch (property_id) {
case FPRINT_DEVICE_CONSTRUCT_DEV:
priv->dev = g_value_dup_object(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
break;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
}
static void fprint_device_get_property(GObject *object, guint property_id,
......@@ -178,12 +166,6 @@ static void fprint_device_get_property(GObject *object, guint property_id,
FprintDevicePrivate *priv = fprint_device_get_instance_private(self);
switch (property_id) {
case FPRINT_DEVICE_CONSTRUCT_DEV:
g_value_set_object(value, priv->dev);
break;
case FPRINT_DEVICE_IN_USE:
g_value_set_boolean(value, g_hash_table_size (priv->clients) != 0);
break;
case FPRINT_DEVICE_NAME:
g_value_set_static_string (value, fp_device_get_name (priv->dev));
break;
......@@ -222,19 +204,6 @@ static void fprint_device_class_init(FprintDeviceClass *klass)
gobject_class->set_property = fprint_device_set_property;
gobject_class->get_property = fprint_device_get_property;
pspec = g_param_spec_object("dev", "Device",
"Set device construction property",
FP_TYPE_DEVICE,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_READABLE);
g_object_class_install_property(gobject_class,
FPRINT_DEVICE_CONSTRUCT_DEV, pspec);
pspec = g_param_spec_boolean("in-use", "In use",
"Whether the device is currently in use", FALSE,
G_PARAM_READABLE);
g_object_class_install_property(gobject_class,
FPRINT_DEVICE_IN_USE, pspec);
pspec = g_param_spec_string("name", "Name",
"The product name of the device", NULL,
G_PARAM_READABLE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment