[gnome-builder/gnome-builder-3-32] code: ensure empty temporary files are saved to disk
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-32] code: ensure empty temporary files are saved to disk
- Date: Sat, 6 Apr 2019 16:51:13 +0000 (UTC)
commit c9a8284b6f33a521bae67188006407d4445372be
Author: Christian Hergert <chergert redhat com>
Date: Sat Apr 6 09:50:11 2019 -0700
code: ensure empty temporary files are saved to disk
If the user sets a file to be saved, then we want to ensure that even
empty temporary files get a new file on disk.
Fixes #876
src/libide/code/ide-buffer.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/src/libide/code/ide-buffer.c b/src/libide/code/ide-buffer.c
index 224832445..5978216c8 100644
--- a/src/libide/code/ide-buffer.c
+++ b/src/libide/code/ide-buffer.c
@@ -1541,6 +1541,10 @@ ide_buffer_save_file_async (IdeBuffer *self,
{
_ide_buffer_set_file (self, file);
self->is_temporary = FALSE;
+
+ /* The buffer might be empty, so mark it as modified so we really save */
+ gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (self), TRUE);
+
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_IS_TEMPORARY]);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_TITLE]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]