[gedit/wip/loader-saver: 27/52] GeditDocument: remove the "newline-type" property



commit 5d9a41bf26018d24bd92cb7432a01a1fc7c0075b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jun 26 22:56:25 2014 +0200

    GeditDocument: remove the "newline-type" property
    
    The property has been migrated to GtkSourceFile.

 gedit/gedit-document.c |   42 +-----------------------------------------
 1 files changed, 1 insertions(+), 41 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 7686776..d145bb9 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -72,8 +72,6 @@ struct _GeditDocumentPrivate
         */
        GtkSourceSearchContext *search_context;
 
-       GtkSourceNewlineType newline_type;
-
        /* Temp data while loading */
        gboolean             create; /* Create file if uri points
                                      * to a non existing file */
@@ -103,7 +101,6 @@ enum
        PROP_MIME_TYPE,
        PROP_READ_ONLY,
        PROP_ENCODING,
-       PROP_NEWLINE_TYPE,
        PROP_EMPTY_SEARCH
 };
 
@@ -156,18 +153,6 @@ release_untitled_number (gint n)
        g_hash_table_remove (allocated_untitled_numbers, GINT_TO_POINTER (n));
 }
 
-static void
-set_newline_type (GeditDocument        *doc,
-                 GtkSourceNewlineType  newline_type)
-{
-       if (doc->priv->newline_type != newline_type)
-       {
-               doc->priv->newline_type = newline_type;
-
-               g_object_notify (G_OBJECT (doc), "newline-type");
-       }
-}
-
 static const gchar *
 get_language_metadata (GeditDocument *doc)
 {
@@ -289,10 +274,6 @@ gedit_document_get_property (GObject    *object,
                        g_value_set_boxed (value, doc->priv->encoding);
                        break;
 
-               case PROP_NEWLINE_TYPE:
-                       g_value_set_enum (value, doc->priv->newline_type);
-                       break;
-
                case PROP_EMPTY_SEARCH:
                        g_value_set_boolean (value, doc->priv->empty_search);
                        break;
@@ -335,10 +316,6 @@ gedit_document_set_property (GObject      *object,
                        gedit_document_set_content_type (doc, g_value_get_string (value));
                        break;
 
-               case PROP_NEWLINE_TYPE:
-                       set_newline_type (doc, g_value_get_enum (value));
-                       break;
-
                default:
                        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
                        break;
@@ -437,23 +414,6 @@ gedit_document_class_init (GeditDocumentClass *klass)
                                                             G_PARAM_STATIC_STRINGS));
 
        /**
-        * GeditDocument:newline-type:
-        *
-        * The :newline-type property determines what is considered
-        * as a line ending when saving the document
-        */
-       g_object_class_install_property (object_class, PROP_NEWLINE_TYPE,
-                                        g_param_spec_enum ("newline-type",
-                                                           "Newline type",
-                                                           "The accepted types of line ending",
-                                                           GTK_SOURCE_TYPE_NEWLINE_TYPE,
-                                                           GTK_SOURCE_NEWLINE_TYPE_LF,
-                                                           G_PARAM_READWRITE |
-                                                           G_PARAM_CONSTRUCT |
-                                                           G_PARAM_STATIC_NAME |
-                                                           G_PARAM_STATIC_BLURB));
-
-       /**
         * GeditDocument:empty-search:
         *
         * <warning>
@@ -1501,7 +1461,7 @@ gedit_document_get_newline_type (GeditDocument *doc)
 {
        g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), 0);
 
-       return doc->priv->newline_type;
+       return gtk_source_file_get_newline_type (doc->priv->file);
 }
 
 GtkSourceCompressionType


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