Commit 7dfcaca9 authored by Christian Kellner's avatar Christian Kellner
Browse files

device: add 'Device.StoreTime' property

parent 31dc6a42
......@@ -71,6 +71,7 @@ struct _BoltDevice
BoltStore *store;
BoltPolicy policy;
BoltKeyState key;
guint64 storetime;
char *label;
};
......@@ -96,6 +97,7 @@ enum {
PROP_STORED,
PROP_POLICY,
PROP_HAVE_KEY,
PROP_STORETIME,
PROP_LABEL,
PROP_LAST,
......@@ -202,6 +204,10 @@ bolt_device_get_property (GObject *object,
g_value_set_uint (value, dev->key);
break;
case PROP_STORETIME:
g_value_set_uint64 (value, dev->storetime);
break;
case PROP_LABEL:
g_value_set_string (value, dev->label);
break;
......@@ -286,6 +292,10 @@ bolt_device_set_property (GObject *object,
dev->key = g_value_get_uint (value);
break;
case PROP_STORETIME:
dev->storetime = g_value_get_uint64 (value);
break;
case PROP_LABEL:
g_clear_pointer (&dev->label, g_free);
dev->label = g_value_dup_string (value);
......@@ -413,6 +423,13 @@ bolt_device_class_init (BoltDeviceClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
props[PROP_STORETIME] =
g_param_spec_uint64 ("storetime",
"StoreTime", NULL,
0, G_MAXUINT64, 0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
props[PROP_LABEL] =
g_param_spec_string ("label",
"Label", NULL,
......@@ -1211,3 +1228,9 @@ bolt_device_get_label (const BoltDevice *dev)
{
return dev->label;
}
gint64
bolt_device_get_storetime (const BoltDevice *dev)
{
return dev->storetime;
}
......@@ -80,4 +80,6 @@ BoltDeviceType bolt_device_get_device_type (const BoltDevice *dev);
const char * bolt_device_get_label (const BoltDevice *dev);
gint64 bolt_device_get_storetime (const BoltDevice *dev);
G_END_DECLS
......@@ -232,6 +232,14 @@
</doc:para></doc:description></doc:doc>
</property>
<property name="StoreTime" type="t" access="read">
<doc:doc><doc:description><doc:para>
Point in time (since Epoch, in seconds) when the
device was stored (0 if it is not stored).
</doc:para></doc:description></doc:doc>
</property>
<!-- methods -->
<method name="Authorize">
......
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