mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: add dbus utility
This allows viewing the message contents that were captured in a textview within the utility pane. We already limit the max size of a message in the capture file, so presumably messages are relatively small enough to fit here.
This commit is contained in:
@ -51,6 +51,7 @@ enum {
|
||||
PROP_SIGNATURE,
|
||||
PROP_SENDER,
|
||||
PROP_SERIAL,
|
||||
PROP_STRING,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
@ -130,6 +131,10 @@ sysprof_document_dbus_message_get_property (GObject *object,
|
||||
g_value_set_string (value, sysprof_document_dbus_message_get_signature (self));
|
||||
break;
|
||||
|
||||
case PROP_STRING:
|
||||
g_value_take_string (value, sysprof_document_dbus_message_dup_string (self));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
@ -214,6 +219,11 @@ sysprof_document_dbus_message_class_init (SysprofDocumentDBusMessageClass *klass
|
||||
0,
|
||||
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
properties[PROP_STRING] =
|
||||
g_param_spec_string ("string", NULL, NULL,
|
||||
NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||
}
|
||||
|
||||
@ -444,3 +454,16 @@ sysprof_document_dbus_message_get_bus_type (SysprofDocumentDBusMessage *self)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
sysprof_document_dbus_message_dup_string (SysprofDocumentDBusMessage *self)
|
||||
{
|
||||
g_autoptr(GDBusMessage) message = NULL;
|
||||
|
||||
g_return_val_if_fail (SYSPROF_IS_DOCUMENT_DBUS_MESSAGE (self), NULL);
|
||||
|
||||
if (!(message = sysprof_document_dbus_message_dup_message (self)))
|
||||
return NULL;
|
||||
|
||||
return g_dbus_message_print (message, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user