[gnome-builder] editor: Fix notify::file buffer signal connection in init()



commit c04edaccf5fa919c4c7e449478da540c231733a1
Author: vanadiae <vanadiae35 gmail com>
Date:   Sun Jul 18 20:10:28 2021 +0200

    editor: Fix notify::file buffer signal connection in init()
    
    It was because the signal was connected before set_buffer() was
    called, when buffer was NULL. Instead just connect notify::file with
    the rest of the buffer, and let the existing DzlBindingGroup handle
    it with the rest of the buffer signals.
    
    Fixes 7aac27d9eb3668bbbb207b10ed7778352e80b5dd

 src/libide/editor/ide-editor-page.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/libide/editor/ide-editor-page.c b/src/libide/editor/ide-editor-page.c
index 0eb20d13b..b5d23ef86 100644
--- a/src/libide/editor/ide-editor-page.c
+++ b/src/libide/editor/ide-editor-page.c
@@ -1014,11 +1014,6 @@ ide_editor_page_init (IdeEditorPage *self)
 
   self->destroy_cancellable = g_cancellable_new ();
 
-  g_signal_connect_swapped (self->buffer,
-                            "notify::file",
-                            G_CALLBACK (ide_editor_page_buffer_notify_file),
-                            self);
-
   /* Setup signals to monitor on the buffer. */
   self->buffer_signals = dzl_signal_group_new (IDE_TYPE_BUFFER);
 
@@ -1032,6 +1027,11 @@ ide_editor_page_init (IdeEditorPage *self)
                                     G_CALLBACK (ide_editor_page_buffer_modified_changed),
                                     self);
 
+  dzl_signal_group_connect_swapped (self->buffer_signals,
+                                    "notify::file",
+                                    G_CALLBACK (ide_editor_page_buffer_notify_file),
+                                    self);
+
   dzl_signal_group_connect_swapped (self->buffer_signals,
                                     "notify::failed",
                                     G_CALLBACK (ide_editor_page_buffer_notify_failed),


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