[gnome-builder] buffer: add IdeBuffer::saved signal



commit 802cb40440d58fa63b51dcb8a3fac38445e0de84
Author: Christian Hergert <christian hergert me>
Date:   Wed May 6 15:31:36 2015 -0700

    buffer: add IdeBuffer::saved signal
    
    This is emitted directly after IdeBufferManager::buffer-saved. It is
    primarily a convenience signal so that listeners do not need to listen
    to all buffer manager saved signals.

 libide/ide-buffer-manager.c |    1 +
 libide/ide-buffer.c         |   15 +++++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-buffer-manager.c b/libide/ide-buffer-manager.c
index 518e946..2b9cd2a 100644
--- a/libide/ide-buffer-manager.c
+++ b/libide/ide-buffer-manager.c
@@ -827,6 +827,7 @@ ide_buffer_manager_save_file__save_cb (GObject      *object,
 
   /* Notify signal handlers that the file is saved */
   g_signal_emit (self, gSignals [BUFFER_SAVED], 0, state->buffer);
+  g_signal_emit_by_name (state->buffer, "saved");
 
   g_task_return_boolean (task, TRUE);
 }
diff --git a/libide/ide-buffer.c b/libide/ide-buffer.c
index 30140a8..5b0255b 100644
--- a/libide/ide-buffer.c
+++ b/libide/ide-buffer.c
@@ -101,6 +101,7 @@ enum {
   CURSOR_MOVED,
   LINE_FLAGS_CHANGED,
   LOADED,
+  SAVED,
   LAST_SIGNAL
 };
 
@@ -1072,6 +1073,20 @@ ide_buffer_class_init (IdeBufferClass *klass)
                   NULL, NULL, NULL,
                   G_TYPE_NONE,
                   0);
+
+  /**
+   * IdeBuffer::saved:
+   *
+   * This signal is emitted when the buffer manager has completed saving the file.
+   */
+  gSignals [SAVED] =
+    g_signal_new ("saved",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST,
+                  0,
+                  NULL, NULL, NULL,
+                  G_TYPE_NONE,
+                  0);
 }
 
 static void


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