[gedit/wip/reusable-code] Some code clean-up to prepare the libgedit



commit 3b0b6c3214d3841172d1dbf6b6a026f558ca46a1
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Sep 10 20:59:06 2013 +0200

    Some code clean-up to prepare the libgedit
    
    Remove the include to config.h where it is not needed.
    config.h is needed in gedit-document-loader.c for
    ENABLE_GVFS_METADATA.

 gedit/gedit-document-input-stream.c  |    2 --
 gedit/gedit-document-input-stream.h  |    1 -
 gedit/gedit-document-loader.c        |    8 --------
 gedit/gedit-document-loader.h        |   28 ++--------------------------
 gedit/gedit-document-output-stream.c |    2 --
 gedit/gedit-document-output-stream.h |    1 -
 gedit/gedit-document-saver.c         |   10 ----------
 gedit/gedit-document-saver.h         |   32 +++-----------------------------
 gedit/gedit-encodings.c              |   19 ++-----------------
 gedit/gedit-encodings.h              |    8 --------
 10 files changed, 7 insertions(+), 104 deletions(-)
---
diff --git a/gedit/gedit-document-input-stream.c b/gedit/gedit-document-input-stream.c
index e54ab50..ad73242 100644
--- a/gedit/gedit-document-input-stream.c
+++ b/gedit/gedit-document-input-stream.c
@@ -20,8 +20,6 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include "config.h"
-
 #include <glib.h>
 #include <gio/gio.h>
 #include <string.h>
diff --git a/gedit/gedit-document-input-stream.h b/gedit/gedit-document-input-stream.h
index ca00970..c5465a5 100644
--- a/gedit/gedit-document-input-stream.h
+++ b/gedit/gedit-document-input-stream.h
@@ -25,7 +25,6 @@
 
 #include <gio/gio.h>
 #include <gtk/gtk.h>
-
 #include "gedit-document.h"
 
 G_BEGIN_DECLS
diff --git a/gedit/gedit-document-loader.c b/gedit/gedit-document-loader.c
index e4b8674..dee2b27 100644
--- a/gedit/gedit-document-loader.c
+++ b/gedit/gedit-document-loader.c
@@ -22,14 +22,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * Modified by the gedit Team, 2005-2008. See the AUTHORS file for a
- * list of people on the gedit Team.
- * See the ChangeLog files for a list of changes.
- *
- * $Id$
- */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
diff --git a/gedit/gedit-document-loader.h b/gedit/gedit-document-loader.h
index 8a2446c..ee4d08b 100644
--- a/gedit/gedit-document-loader.h
+++ b/gedit/gedit-document-loader.h
@@ -22,14 +22,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * Modified by the gedit Team, 2005-2008. See the AUTHORS file for a
- * list of people on the gedit Team.
- * See the ChangeLog files for a list of changes.
- *
- * $Id$
- */
-
 #ifndef __GEDIT_DOCUMENT_LOADER_H__
 #define __GEDIT_DOCUMENT_LOADER_H__
 
@@ -37,9 +29,6 @@
 
 G_BEGIN_DECLS
 
-/*
- * Type checking and casting macros
- */
 #define GEDIT_TYPE_DOCUMENT_LOADER              (gedit_document_loader_get_type())
 #define GEDIT_DOCUMENT_LOADER(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), 
GEDIT_TYPE_DOCUMENT_LOADER, GeditDocumentLoader))
 #define GEDIT_DOCUMENT_LOADER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), 
GEDIT_TYPE_DOCUMENT_LOADER, GeditDocumentLoaderClass))
@@ -47,27 +36,17 @@ G_BEGIN_DECLS
 #define GEDIT_IS_DOCUMENT_LOADER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), 
GEDIT_TYPE_DOCUMENT_LOADER))
 #define GEDIT_DOCUMENT_LOADER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), 
GEDIT_TYPE_DOCUMENT_LOADER, GeditDocumentLoaderClass))
 
-/* Private structure type */
+typedef struct _GeditDocumentLoader        GeditDocumentLoader;
+typedef struct _GeditDocumentLoaderClass   GeditDocumentLoaderClass;
 typedef struct _GeditDocumentLoaderPrivate GeditDocumentLoaderPrivate;
 
-/*
- * Main object structure
- */
-typedef struct _GeditDocumentLoader GeditDocumentLoader;
-
 struct _GeditDocumentLoader
 {
        GObject object;
 
-       /*< private > */
        GeditDocumentLoaderPrivate *priv;
 };
 
-/*
- * Class definition
- */
-typedef struct _GeditDocumentLoaderClass GeditDocumentLoaderClass;
-
 struct _GeditDocumentLoaderClass
 {
        GObjectClass parent_class;
@@ -78,9 +57,6 @@ struct _GeditDocumentLoaderClass
                          const GError        *error);
 };
 
-/*
- * Public methods
- */
 GType                   gedit_document_loader_get_type         (void) G_GNUC_CONST;
 
 /* If enconding == NULL, the encoding will be autodetected */
diff --git a/gedit/gedit-document-output-stream.c b/gedit/gedit-document-output-stream.c
index dd5a95d..7790097 100644
--- a/gedit/gedit-document-output-stream.c
+++ b/gedit/gedit-document-output-stream.c
@@ -20,8 +20,6 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include "config.h"
-
 #include <string.h>
 #include <glib.h>
 #include <glib/gi18n.h>
diff --git a/gedit/gedit-document-output-stream.h b/gedit/gedit-document-output-stream.h
index 68996a5..97eee85 100644
--- a/gedit/gedit-document-output-stream.h
+++ b/gedit/gedit-document-output-stream.h
@@ -20,7 +20,6 @@
  * Boston, MA  02110-1301  USA
  */
 
-
 #ifndef __GEDIT_DOCUMENT_OUTPUT_STREAM_H__
 #define __GEDIT_DOCUMENT_OUTPUT_STREAM_H__
 
diff --git a/gedit/gedit-document-saver.c b/gedit/gedit-document-saver.c
index 1cffdc4..25e4695 100644
--- a/gedit/gedit-document-saver.c
+++ b/gedit/gedit-document-saver.c
@@ -22,16 +22,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * Modified by the gedit Team, 2005-2006. See the AUTHORS file for a
- * list of people on the gedit Team.
- * See the ChangeLog files for a list of changes.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <glib/gi18n.h>
 #include <glib.h>
 #include <gio/gio.h>
diff --git a/gedit/gedit-document-saver.h b/gedit/gedit-document-saver.h
index c4ddf59..8564d77 100644
--- a/gedit/gedit-document-saver.h
+++ b/gedit/gedit-document-saver.h
@@ -22,22 +22,13 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * Modified by the gedit Team, 2005-2007. See the AUTHORS file for a
- * list of people on the gedit Team.
- * See the ChangeLog files for a list of changes.
- */
-
 #ifndef __GEDIT_DOCUMENT_SAVER_H__
 #define __GEDIT_DOCUMENT_SAVER_H__
 
-#include <gedit/gedit-document.h>
+#include "gedit-document.h"
 
 G_BEGIN_DECLS
 
-/*
- * Type checking and casting macros
- */
 #define GEDIT_TYPE_DOCUMENT_SAVER              (gedit_document_saver_get_type())
 #define GEDIT_DOCUMENT_SAVER(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_DOCUMENT_SAVER, 
GeditDocumentSaver))
 #define GEDIT_DOCUMENT_SAVER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_DOCUMENT_SAVER, 
GeditDocumentSaverClass))
@@ -45,27 +36,17 @@ G_BEGIN_DECLS
 #define GEDIT_IS_DOCUMENT_SAVER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_DOCUMENT_SAVER))
 #define GEDIT_DOCUMENT_SAVER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_DOCUMENT_SAVER, 
GeditDocumentSaverClass))
 
-/* Private structure type */
+typedef struct _GeditDocumentSaver        GeditDocumentSaver;
+typedef struct _GeditDocumentSaverClass   GeditDocumentSaverClass;
 typedef struct _GeditDocumentSaverPrivate GeditDocumentSaverPrivate;
 
-/*
- * Main object structure
- */
-typedef struct _GeditDocumentSaver GeditDocumentSaver;
-
 struct _GeditDocumentSaver
 {
        GObject object;
 
-       /*< private >*/
        GeditDocumentSaverPrivate *priv;
 };
 
-/*
- * Class definition
- */
-typedef struct _GeditDocumentSaverClass GeditDocumentSaverClass;
-
 struct _GeditDocumentSaverClass
 {
        GObjectClass parent_class;
@@ -76,9 +57,6 @@ struct _GeditDocumentSaverClass
                         const GError        *error);
 };
 
-/*
- * Public methods
- */
 GType                   gedit_document_saver_get_type          (void) G_GNUC_CONST;
 
 /* If enconding == NULL, the encoding will be autodetected */
@@ -95,10 +73,6 @@ void                  gedit_document_saver_saving            (GeditDocumentSaver  *saver,
 void                    gedit_document_saver_save              (GeditDocumentSaver  *saver,
                                                                 GTimeVal            *old_mtime);
 
-#if 0
-void                    gedit_document_saver_cancel            (GeditDocumentSaver  *saver);
-#endif
-
 GeditDocument          *gedit_document_saver_get_document      (GeditDocumentSaver  *saver);
 
 GFile                  *gedit_document_saver_get_location      (GeditDocumentSaver  *saver);
diff --git a/gedit/gedit-encodings.c b/gedit/gedit-encodings.c
index ebe31fc..5214fe2 100644
--- a/gedit/gedit-encodings.c
+++ b/gedit/gedit-encodings.c
@@ -20,25 +20,11 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a
- * list of people on the gedit Team.
- * See the ChangeLog files for a list of changes.
- *
- * $Id$
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <string.h>
-
 #include <glib/gi18n.h>
 
 #include "gedit-encodings.h"
 
-
 struct _GeditEncoding
 {
        gint   index;
@@ -58,7 +44,6 @@ G_DEFINE_BOXED_TYPE (GeditEncoding, gedit_encoding,
 
 typedef enum
 {
-
   GEDIT_ENCODING_ISO_8859_1,
   GEDIT_ENCODING_ISO_8859_2,
   GEDIT_ENCODING_ISO_8859_3,
@@ -436,8 +421,8 @@ gedit_encoding_get_name (const GeditEncoding* enc)
 }
 
 /* These are to make language bindings happy. Since Encodings are
- * const, copy() just returns the same pointer and fres() doesn't
- * do nothing */
+ * const, copy() just returns the same pointer and free() does
+ * nothing */
 
 GeditEncoding *
 gedit_encoding_copy (const GeditEncoding *enc)
diff --git a/gedit/gedit-encodings.h b/gedit/gedit-encodings.h
index aa0cf4a..4d28266 100644
--- a/gedit/gedit-encodings.h
+++ b/gedit/gedit-encodings.h
@@ -20,14 +20,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a
- * list of people on the gedit Team.
- * See the ChangeLog files for a list of changes.
- *
- * $Id$
- */
-
 #ifndef __GEDIT_ENCODINGS_H__
 #define __GEDIT_ENCODINGS_H__
 


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