[gnome-builder] buffer-manager: allow saving files that have changed on disk



commit f5840c5ed0a45026ec0b7c41a5bba5435c06e0bd
Author: Christian Hergert <christian hergert me>
Date:   Sun May 17 18:38:02 2015 -0700

    buffer-manager: allow saving files that have changed on disk
    
    We handle the policy for this at a different layer, so setting the
    ignore mtime here should be reasonable. We can remove the XXX once we
    have confirmed this in practice.

 libide/ide-buffer-manager.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-buffer-manager.c b/libide/ide-buffer-manager.c
index 778d00e..7410028 100644
--- a/libide/ide-buffer-manager.c
+++ b/libide/ide-buffer-manager.c
@@ -888,6 +888,13 @@ ide_buffer_manager_save_file__load_settings_cb (GObject      *object,
 
   saver = gtk_source_file_saver_new (GTK_SOURCE_BUFFER (state->buffer), source_file);
 
+  /*
+   * XXX: We need to think this through a bit more, but I think since the UI allows us to
+   *      Reload or Ignore changes, it is safe to always set this here. However, there is the
+   *      ever so slightest race condition between the mtime check and the save anyway.
+   */
+  gtk_source_file_saver_set_flags (saver, GTK_SOURCE_FILE_SAVER_FLAGS_IGNORE_MODIFICATION_TIME);
+
   /* set file encoding and newline style defaults */
   newline_type = ide_file_settings_get_newline_type (file_settings);
   encoding = gtk_source_encoding_get_utf8 ();


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