mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof/logs: ignore -1 for cpu/pid in cells
They just mean empty, so show it as such in the cells.
This commit is contained in:
@ -87,6 +87,16 @@ format_number (gpointer unused,
|
||||
return g_strdup_printf ("%'u", number);
|
||||
}
|
||||
|
||||
static char *
|
||||
int_to_string_filtered (gpointer unused,
|
||||
int value)
|
||||
{
|
||||
if (value < 0)
|
||||
return NULL;
|
||||
|
||||
return g_strdup_printf ("%d", value);
|
||||
}
|
||||
|
||||
static char *
|
||||
format_severity (gpointer unused,
|
||||
GLogLevelFlags severity)
|
||||
@ -135,6 +145,7 @@ sysprof_logs_section_class_init (SysprofLogsSectionClass *klass)
|
||||
gtk_widget_class_bind_template_child (widget_class, SysprofLogsSection, time_column);
|
||||
gtk_widget_class_bind_template_callback (widget_class, format_number);
|
||||
gtk_widget_class_bind_template_callback (widget_class, format_severity);
|
||||
gtk_widget_class_bind_template_callback (widget_class, int_to_string_filtered);
|
||||
gtk_widget_class_bind_template_callback (widget_class, sysprof_logs_section_activate_layer_item_cb);
|
||||
|
||||
g_type_ensure (SYSPROF_TYPE_DOCUMENT_BITSET_INDEX);
|
||||
|
||||
@ -160,9 +160,11 @@
|
||||
<property name="min-chars">2</property>
|
||||
<property name="nat-chars">2</property>
|
||||
<binding name="text">
|
||||
<lookup name="cpu" type="SysprofDocumentLog">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
<closure function="int_to_string_filtered" type="gchararray">
|
||||
<lookup name="cpu" type="SysprofDocumentLog">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</closure>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
@ -196,9 +198,11 @@
|
||||
<property name="min-chars">2</property>
|
||||
<property name="nat-chars">2</property>
|
||||
<binding name="text">
|
||||
<lookup name="pid" type="SysprofDocumentLog">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
<closure function="int_to_string_filtered" type="gchararray">
|
||||
<lookup name="pid" type="SysprofDocumentLog">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</closure>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user