[gnome-builder] code: be more flexible in writes



commit bf9f4524838ac66b2447fd567d8d0941ecab8021
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 17 13:41:07 2019 -0700

    code: be more flexible in writes
    
    We provide ample notification to the user now about changes, so we can
    overwrite the file contents in this workflow.

 src/libide/code/ide-buffer.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/libide/code/ide-buffer.c b/src/libide/code/ide-buffer.c
index 7a736d346..dc8716ce3 100644
--- a/src/libide/code/ide-buffer.c
+++ b/src/libide/code/ide-buffer.c
@@ -1499,6 +1499,12 @@ ide_buffer_save_file_settle_cb (GObject      *object,
     }
 
   saver = gtk_source_file_saver_new (GTK_SOURCE_BUFFER (self), state->source_file);
+  /* At this point, we've notified the user of changes to the underlying file using
+   * the infobar, so just save the file knowing that we are overwriting things.
+   */
+  gtk_source_file_saver_set_flags (saver,
+                                   (GTK_SOURCE_FILE_SAVER_FLAGS_IGNORE_INVALID_CHARS |
+                                    GTK_SOURCE_FILE_SAVER_FLAGS_IGNORE_MODIFICATION_TIME));
   gtk_source_file_saver_save_async (saver,
                                     G_PRIORITY_DEFAULT,
                                     ide_task_get_cancellable (task),


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