[gtksourceview/wip/loader-saver] FileSaver: take the Buffer properties values
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/loader-saver] FileSaver: take the Buffer properties values
- Date: Tue, 1 Apr 2014 22:15:09 +0000 (UTC)
commit 9341a754a30be4219a9212f8f3afd8d384f389c8
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Apr 2 00:14:33 2014 +0200
FileSaver: take the Buffer properties values
gtksourceview/gtksourcefilesaver.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcefilesaver.c b/gtksourceview/gtksourcefilesaver.c
index 937dbd1..70e06c0 100644
--- a/gtksourceview/gtksourcefilesaver.c
+++ b/gtksourceview/gtksourcefilesaver.c
@@ -235,6 +235,30 @@ gtk_source_file_saver_dispose (GObject *object)
}
static void
+gtk_source_file_saver_constructed (GObject *object)
+{
+ GtkSourceFileSaver *saver = GTK_SOURCE_FILE_SAVER (object);
+
+ if (saver->priv->source_buffer != NULL)
+ {
+ const GtkSourceEncoding *encoding;
+ GtkSourceNewlineType newline_type;
+ GtkSourceCompressionType compression_type;
+
+ encoding = gtk_source_buffer_get_encoding (saver->priv->source_buffer);
+ gtk_source_file_saver_set_encoding (saver, encoding);
+
+ newline_type = gtk_source_buffer_get_newline_type (saver->priv->source_buffer);
+ gtk_source_file_saver_set_newline_type (saver, newline_type);
+
+ compression_type = gtk_source_buffer_get_compression_type (saver->priv->source_buffer);
+ gtk_source_file_saver_set_compression_type (saver, compression_type);
+ }
+
+ G_OBJECT_CLASS (gtk_source_file_saver_parent_class)->constructed (object);
+}
+
+static void
gtk_source_file_saver_class_init (GtkSourceFileSaverClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -242,6 +266,7 @@ gtk_source_file_saver_class_init (GtkSourceFileSaverClass *klass)
object_class->dispose = gtk_source_file_saver_dispose;
object_class->set_property = gtk_source_file_saver_set_property;
object_class->get_property = gtk_source_file_saver_get_property;
+ object_class->constructed = gtk_source_file_saver_constructed;
/**
* GtkSourceFileSaver:buffer:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]