[sysprof/wip/visualizers] cpu-visualizer-row: hide if no counters were found



commit ad130db3d6e1f5d49188fe3bbe2729f91b060b27
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 27 16:44:23 2016 -0700

    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 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/lib/sp-cpu-visualizer-row.c b/lib/sp-cpu-visualizer-row.c
index 7a74639..121ebf9 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]