[gnome-builder/gnome-builder-3-32] auto-save: only auto-save if unchanged on disk
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-32] auto-save: only auto-save if unchanged on disk
- Date: Fri, 17 May 2019 20:42:10 +0000 (UTC)
commit e6cc4ad73adf529835ff4eb6ccacbca439a61e71
Author: Christian Hergert <chergert redhat com>
Date: Fri May 17 13:38:12 2019 -0700
auto-save: only auto-save if unchanged on disk
src/plugins/auto-save/gbp-auto-save-buffer-addin.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/auto-save/gbp-auto-save-buffer-addin.c
b/src/plugins/auto-save/gbp-auto-save-buffer-addin.c
index 404d2f2a0..adbe58b58 100644
--- a/src/plugins/auto-save/gbp-auto-save-buffer-addin.c
+++ b/src/plugins/auto-save/gbp-auto-save-buffer-addin.c
@@ -45,7 +45,11 @@ gbp_auto_save_buffer_addin_source_cb (gpointer user_data)
self->source_id = 0;
- if (gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (self->buffer)))
+ /* Only auto-save if there are no active changes and the file has not been
+ * changed out from under us on the storage volume.
+ */
+ if (!ide_buffer_get_changed_on_volume (self->buffer) &&
+ gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (self->buffer)))
ide_buffer_save_file_async (self->buffer, NULL, NULL, NULL, NULL, NULL);
return G_SOURCE_REMOVE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]