[gnome-builder] buffer-manager: clear unsaved state when saving buffers



commit b92ceeea3d853f7687fb877bb85a6033246c1db6
Author: Christian Hergert <christian hergert me>
Date:   Fri Apr 24 13:50:45 2015 -0700

    buffer-manager: clear unsaved state when saving buffers

 libide/ide-buffer-manager.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-buffer-manager.c b/libide/ide-buffer-manager.c
index 14dbba4..cb8e20d 100644
--- a/libide/ide-buffer-manager.c
+++ b/libide/ide-buffer-manager.c
@@ -34,6 +34,7 @@
 #include "ide-internal.h"
 #include "ide-progress.h"
 #include "ide-source-location.h"
+#include "ide-unsaved-files.h"
 #include "ide-vcs.h"
 
 #define AUTO_SAVE_TIMEOUT_DEFAULT    60
@@ -766,7 +767,10 @@ ide_buffer_manager_save_file__save_cb (GObject      *object,
   g_autoptr(GTask) task = user_data;
   GtkSourceFileSaver *saver = (GtkSourceFileSaver *)object;
   IdeBufferManager *self;
+  IdeUnsavedFiles *unsaved_files;
+  IdeContext *context;
   IdeFile *file;
+  GFile *gfile;
   SaveState *state;
   GError *error = NULL;
 
@@ -794,6 +798,12 @@ ide_buffer_manager_save_file__save_cb (GObject      *object,
   if (ide_file_equal (file, state->file))
     gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (state->buffer), FALSE);
 
+  /* remove the unsaved files state */
+  context = ide_object_get_context (IDE_OBJECT (self));
+  unsaved_files = ide_context_get_unsaved_files (context);
+  gfile = ide_file_get_file (state->file);
+  ide_unsaved_files_update (unsaved_files, gfile, NULL);
+
   /* Notify signal handlers that the file is saved */
   g_signal_emit (self, gSignals [BUFFER_SAVED], 0, state->buffer);
 


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