[gnome-builder/wip/chergert/bug1: 55/69] debugger: clear list store when debugger is attached



commit 881391a7dc23223262299873b63775ed89dc7ab4
Author: Christian Hergert <chergert redhat com>
Date:   Thu Aug 31 00:41:48 2017 -0700

    debugger: clear list store when debugger is attached

 libide/debugger/ide-debugger-breakpoints-view.c |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/libide/debugger/ide-debugger-breakpoints-view.c b/libide/debugger/ide-debugger-breakpoints-view.c
index f56f4ce..6c7761e 100644
--- a/libide/debugger/ide-debugger-breakpoints-view.c
+++ b/libide/debugger/ide-debugger-breakpoints-view.c
@@ -24,10 +24,10 @@
 
 struct _IdeDebuggerBreakpointsView
 {
-  GtkBin          parent_instance;
+  GtkBin                 parent_instance;
 
   /* Owned references */
-  DzlSignalGroup *debugger_signals;
+  DzlSignalGroup        *debugger_signals;
 
   /* Template references */
   GtkCellRendererText   *address_cell;
@@ -63,6 +63,18 @@ G_DEFINE_TYPE (IdeDebuggerBreakpointsView, ide_debugger_breakpoints_view, GTK_TY
 static GParamSpec *properties [N_PROPS];
 
 static void
+ide_debugger_breakpoints_view_bind (IdeDebuggerBreakpointsView *self,
+                                    IdeDebugger                *debugger,
+                                    DzlSignalGroup             *debugger_signals)
+{
+  g_assert (IDE_IS_DEBUGGER_BREAKPOINTS_VIEW (self));
+  g_assert (IDE_IS_DEBUGGER (debugger));
+  g_assert (DZL_IS_SIGNAL_GROUP (debugger_signals));
+
+  gtk_list_store_clear (self->list_store);
+}
+
+static void
 ide_debugger_breakpoints_view_running (IdeDebuggerBreakpointsView *self,
                                        IdeDebugger                *debugger)
 {
@@ -458,6 +470,11 @@ ide_debugger_breakpoints_view_init (IdeDebuggerBreakpointsView *self)
 
   self->debugger_signals = dzl_signal_group_new (IDE_TYPE_DEBUGGER);
 
+  g_signal_connect_swapped (self->debugger_signals,
+                            "bind",
+                            G_CALLBACK (ide_debugger_breakpoints_view_bind),
+                            self);
+
   dzl_signal_group_connect_swapped (self->debugger_signals,
                                     "running",
                                     G_CALLBACK (ide_debugger_breakpoints_view_running),


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