From 36008c4ab4a39f0512837bdee93a3686d611806d Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 15 Apr 2016 18:11:31 -0700 Subject: [PATCH] window: notify the user when no valid samples were collected If we failed to collect any samples in the target profile, let the user know why the callgraph is empty. --- src/sp-window.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sp-window.c b/src/sp-window.c index 36c0e8f6..2cf5805d 100644 --- a/src/sp-window.c +++ b/src/sp-window.c @@ -212,6 +212,11 @@ sp_window_build_profile_cb (GObject *object, sp_callgraph_view_set_profile (self->callgraph_view, SP_CALLGRAPH_PROFILE (profile)); sp_window_set_state (self, SP_WINDOW_STATE_BROWSING); + + if (sp_callgraph_view_get_n_functions (self->callgraph_view) == 0) + sp_window_notify_user (self, + GTK_MESSAGE_WARNING, + _("Not enough samples were collected to generate a callgraph")); } static void