[gedit/wip/loader-saver: 40/48] GeditDocument: bind the implicit-trailing-newline property
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/loader-saver: 40/48] GeditDocument: bind the implicit-trailing-newline property
- Date: Wed, 9 Jul 2014 11:11:23 +0000 (UTC)
commit d3731be3b237d05f3a2c6c5661bf67cbbc8f27a9
Author: Sébastien Wilmet <swilmet gnome org>
Date: Mon Jun 30 19:34:48 2014 +0200
GeditDocument: bind the implicit-trailing-newline property
gedit/gedit-document.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index b5872ff..ab7e531 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -318,6 +318,21 @@ gedit_document_changed (GtkTextBuffer *buffer)
}
static void
+gedit_document_constructed (GObject *object)
+{
+ GeditDocument *doc = GEDIT_DOCUMENT (object);
+
+ /* Bind construct properties. */
+ g_settings_bind (doc->priv->editor_settings,
+ GEDIT_SETTINGS_ENSURE_TRAILING_NEWLINE,
+ doc,
+ "implicit-trailing-newline",
+ G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
+
+ G_OBJECT_CLASS (gedit_document_parent_class)->constructed (object);
+}
+
+static void
gedit_document_class_init (GeditDocumentClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -327,6 +342,7 @@ gedit_document_class_init (GeditDocumentClass *klass)
object_class->finalize = gedit_document_finalize;
object_class->get_property = gedit_document_get_property;
object_class->set_property = gedit_document_set_property;
+ object_class->constructed = gedit_document_constructed;
buf_class->mark_set = gedit_document_mark_set;
buf_class->changed = gedit_document_changed;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]