[gnome-builder] libide: remove duplicate code



commit 436568511cb23137492a6a36fe03e1c596f928e4
Author: Christian Hergert <christian hergert me>
Date:   Thu Feb 26 22:17:58 2015 -0800

    libide: remove duplicate code

 libide/ide-buffer.c |   23 ++---------------------
 1 files changed, 2 insertions(+), 21 deletions(-)
---
diff --git a/libide/ide-buffer.c b/libide/ide-buffer.c
index 922d2ff..d7fe4ee 100644
--- a/libide/ide-buffer.c
+++ b/libide/ide-buffer.c
@@ -125,31 +125,12 @@ ide_buffer_set_context (IdeBuffer  *self,
 static void
 ide_buffer_sync_to_unsaved_files (IdeBuffer *self)
 {
-  IdeUnsavedFiles *unsaved_files;
-  GtkTextBuffer *buffer = (GtkTextBuffer *)self;
-  gchar *text;
-  GFile *gfile;
   GBytes *content;
-  GtkTextIter begin;
-  GtkTextIter end;
 
   g_assert (IDE_IS_BUFFER (self));
 
-  if (!self->context || !self->file)
-    return;
-
-  gfile = ide_file_get_file (self->file);
-  if (!gfile)
-    return;
-
-  gtk_text_buffer_get_bounds (buffer, &begin, &end);
-  text = gtk_text_buffer_get_text (buffer, &begin, &end, TRUE);
-  content = g_bytes_new_take (text, strlen (text));
-
-  unsaved_files = ide_context_get_unsaved_files (self->context);
-  ide_unsaved_files_update (unsaved_files, gfile, content);
-
-  g_bytes_unref (content);
+  if ((content = ide_buffer_get_content (self)))
+    g_bytes_unref (content);
 }
 
 static void


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