[gedit/wip/loader-saver: 5/16] GeditDocument: remove the "compression-type" property



commit d78ceb391730e27daedeb3bb87bd5f9aa7061349
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jun 26 22:52:08 2014 +0200

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

 gedit/gedit-document.c |   43 +------------------------------------------
 1 files changed, 1 insertions(+), 42 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 8e17c71..819b96a 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -26,8 +26,6 @@
 #endif
 
 #include <string.h>
-#include <stdlib.h>
-
 #include <glib/gi18n.h>
 
 #include "gedit-document.h"
@@ -75,7 +73,6 @@ struct _GeditDocumentPrivate
        GtkSourceSearchContext *search_context;
 
        GtkSourceNewlineType newline_type;
-       GtkSourceCompressionType compression_type;
 
        /* Temp data while loading */
        gboolean             create; /* Create file if uri points
@@ -107,7 +104,6 @@ enum
        PROP_READ_ONLY,
        PROP_ENCODING,
        PROP_NEWLINE_TYPE,
-       PROP_COMPRESSION_TYPE,
        PROP_EMPTY_SEARCH
 };
 
@@ -172,18 +168,6 @@ set_newline_type (GeditDocument        *doc,
        }
 }
 
-static void
-set_compression_type (GeditDocument            *doc,
-                     GtkSourceCompressionType  compression_type)
-{
-       if (doc->priv->compression_type != compression_type)
-       {
-               doc->priv->compression_type = compression_type;
-
-               g_object_notify (G_OBJECT (doc), "compression-type");
-       }
-}
-
 static const gchar *
 get_language_metadata (GeditDocument *doc)
 {
@@ -309,10 +293,6 @@ gedit_document_get_property (GObject    *object,
                        g_value_set_enum (value, doc->priv->newline_type);
                        break;
 
-               case PROP_COMPRESSION_TYPE:
-                       g_value_set_enum (value, doc->priv->compression_type);
-                       break;
-
                case PROP_EMPTY_SEARCH:
                        g_value_set_boolean (value, doc->priv->empty_search);
                        break;
@@ -359,10 +339,6 @@ gedit_document_set_property (GObject      *object,
                        set_newline_type (doc, g_value_get_enum (value));
                        break;
 
-               case PROP_COMPRESSION_TYPE:
-                       set_compression_type (doc, g_value_get_enum (value));
-                       break;
-
                default:
                        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
                        break;
@@ -478,23 +454,6 @@ gedit_document_class_init (GeditDocumentClass *klass)
                                                            G_PARAM_STATIC_BLURB));
 
        /**
-        * GeditDocument:compression-type:
-        *
-        * The :compression-type property determines how to compress the
-        * document when saving
-        */
-       g_object_class_install_property (object_class, PROP_COMPRESSION_TYPE,
-                                        g_param_spec_enum ("compression-type",
-                                                           "Compression type",
-                                                           "The save compression type",
-                                                           GTK_SOURCE_TYPE_COMPRESSION_TYPE,
-                                                           GTK_SOURCE_COMPRESSION_TYPE_NONE,
-                                                           G_PARAM_READWRITE |
-                                                           G_PARAM_CONSTRUCT |
-                                                           G_PARAM_STATIC_NAME |
-                                                           G_PARAM_STATIC_BLURB));
-
-       /**
         * GeditDocument:empty-search:
         *
         * <warning>
@@ -1550,7 +1509,7 @@ gedit_document_get_compression_type (GeditDocument *doc)
 {
        g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), 0);
 
-       return doc->priv->compression_type;
+       return gtk_source_file_get_compression_type (doc->priv->file);
 }
 
 void


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