mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-analyze: add property for counter value as a string
This commit is contained in:
@ -38,6 +38,7 @@ enum {
|
|||||||
PROP_TIME_OFFSET,
|
PROP_TIME_OFFSET,
|
||||||
PROP_VALUE_DOUBLE,
|
PROP_VALUE_DOUBLE,
|
||||||
PROP_VALUE_INT64,
|
PROP_VALUE_INT64,
|
||||||
|
PROP_VALUE_STRING,
|
||||||
N_PROPS
|
N_PROPS
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -75,6 +76,10 @@ sysprof_document_counter_value_get_property (GObject *object,
|
|||||||
g_value_set_int64 (value, sysprof_document_counter_value_get_value_int64 (self));
|
g_value_set_int64 (value, sysprof_document_counter_value_get_value_int64 (self));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_VALUE_STRING:
|
||||||
|
g_value_take_string (value, sysprof_document_counter_value_format (self));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
}
|
}
|
||||||
@ -112,6 +117,11 @@ sysprof_document_counter_value_class_init (SysprofDocumentCounterValueClass *kla
|
|||||||
G_MININT64, G_MAXINT64, 0,
|
G_MININT64, G_MAXINT64, 0,
|
||||||
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
properties[PROP_VALUE_STRING] =
|
||||||
|
g_param_spec_string ("value-string", NULL, NULL,
|
||||||
|
NULL,
|
||||||
|
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -214,7 +214,7 @@
|
|||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<binding name="label">
|
<binding name="label">
|
||||||
<lookup name="value-double" type="SysprofDocumentCounterValue">
|
<lookup name="value-string" type="SysprofDocumentCounterValue">
|
||||||
<lookup name="item">GtkListItem</lookup>
|
<lookup name="item">GtkListItem</lookup>
|
||||||
</lookup>
|
</lookup>
|
||||||
</binding>
|
</binding>
|
||||||
|
|||||||
Reference in New Issue
Block a user