libsysprof-analyze: add property for counter value as a string

This commit is contained in:
Christian Hergert
2023-07-14 20:09:05 -07:00
parent 95a7ceb1ae
commit 6dd8f7014f
2 changed files with 11 additions and 1 deletions

View File

@ -38,6 +38,7 @@ enum {
PROP_TIME_OFFSET,
PROP_VALUE_DOUBLE,
PROP_VALUE_INT64,
PROP_VALUE_STRING,
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));
break;
case PROP_VALUE_STRING:
g_value_take_string (value, sysprof_document_counter_value_format (self));
break;
default:
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_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);
}

View File

@ -214,7 +214,7 @@
<object class="GtkLabel">
<property name="xalign">0</property>
<binding name="label">
<lookup name="value-double" type="SysprofDocumentCounterValue">
<lookup name="value-string" type="SysprofDocumentCounterValue">
<lookup name="item">GtkListItem</lookup>
</lookup>
</binding>