[gnome-builder/wip/chergert/bug1: 32/32] debugger: only clear debugger when new instance is set



commit a5f342bfe7c183324eff0e6ed50adbe517eb9f60
Author: Christian Hergert <chergert redhat com>
Date:   Mon Aug 28 12:25:17 2017 -0700

    debugger: only clear debugger when new instance is set
    
    If we are clearing the old debugger because it ended, keep the log alive
    for the user to potentially glean some insight.

 libide/debugger/ide-debugger-perspective.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/libide/debugger/ide-debugger-perspective.c b/libide/debugger/ide-debugger-perspective.c
index 9223b8f..e8ae7fe 100644
--- a/libide/debugger/ide-debugger-perspective.c
+++ b/libide/debugger/ide-debugger-perspective.c
@@ -136,8 +136,14 @@ ide_debugger_perspective_set_debugger (IdeDebuggerPerspective *self,
 
   if (g_set_object (&self->debugger, debugger))
     {
+      /* Clear the log if this is a new debugger instance,
+       * otherwise allow the user to read the backlog in case
+       * there was something useful for debugging.
+       */
+      if (debugger != NULL)
+        gtk_text_buffer_set_text (self->log_buffer, "", 0);
+
       dzl_signal_group_set_target (self->debugger_signals, debugger);
-      gtk_text_buffer_set_text (self->log_buffer, "", 0);
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUGGER]);
     }
 


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