[gnome-builder/editor-layout] track modified state when saving



commit ebd2d7cfe24cc0891497bf0d14a5feb1e2322982
Author: Christian Hergert <christian hergert me>
Date:   Sun Nov 30 04:58:53 2014 -0800

    track modified state when saving

 src/editor/gb-editor-document.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/editor/gb-editor-document.c b/src/editor/gb-editor-document.c
index 3e32dc3..b7d871a 100644
--- a/src/editor/gb-editor-document.c
+++ b/src/editor/gb-editor-document.c
@@ -375,6 +375,7 @@ gb_editor_document_save_cb (GObject      *object,
                             gpointer      user_data)
 {
   GtkSourceFileSaver *saver = (GtkSourceFileSaver *)object;
+  GbEditorDocument *document;
   GError *error = NULL;
   GTask *task = user_data;
 
@@ -390,6 +391,16 @@ gb_editor_document_save_cb (GObject      *object,
       GOTO (cleanup);
     }
 
+  /*
+   * FIXME:
+   *
+   *   Technically this can race. We need to either disable the editing
+   *   for the buffer during the process or keep a sequence number to
+   *   ensure it hasn't changed since we started the request to save.
+   */
+  document = g_task_get_source_object (task);
+  gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (document), FALSE);
+
   g_task_return_boolean (task, TRUE);
 
 cleanup:


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