From ad130db3d6e1f5d49188fe3bbe2729f91b060b27 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 27 Sep 2016 16:44:23 -0700 Subject: [PATCH] cpu-visualizer-row: hide if no counters were found If we failed to locate any counters, then there isn't much we can show the user here. So just hide the row. --- lib/sp-cpu-visualizer-row.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/sp-cpu-visualizer-row.c b/lib/sp-cpu-visualizer-row.c index 7a746396..121ebf9e 100644 --- a/lib/sp-cpu-visualizer-row.c +++ b/lib/sp-cpu-visualizer-row.c @@ -102,6 +102,9 @@ complete_counters (GObject *object, sp_line_visualizer_row_add_counter (SP_LINE_VISUALIZER_ROW (self), counter_id); } } + + /* Hide ourself if we failed to locate counters */ + gtk_widget_set_visible (GTK_WIDGET (self), counters != NULL && counters->len > 0); } static void