[gedit] More precise return type for _gedit_app_get_settings()



commit 1db5312c059a1a395b2755a7b12b7c44f890665d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Jun 24 18:20:48 2015 +0200

    More precise return type for _gedit_app_get_settings()
    
    The code is clearer with GeditSettings.

 gedit/gedit-app-private.h        |    3 ++-
 gedit/gedit-app.c                |    4 ++--
 gedit/gedit-preferences-dialog.c |    4 ++--
 gedit/gedit-view.c               |    4 ++--
 4 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/gedit/gedit-app-private.h b/gedit/gedit-app-private.h
index b53b370..a827642 100644
--- a/gedit/gedit-app-private.h
+++ b/gedit/gedit-app-private.h
@@ -22,6 +22,7 @@
 #define __GEDIT_APP_PRIVATE_H__
 
 #include "gedit-app.h"
+#include "gedit-settings.h"
 #include "gedit-menu-extension.h"
 
 G_BEGIN_DECLS
@@ -47,7 +48,7 @@ GtkPrintSettings      *_gedit_app_get_default_print_settings  (GeditApp         *app);
 void                    _gedit_app_set_default_print_settings  (GeditApp         *app,
                                                                 GtkPrintSettings *settings);
 
-GObject                        *_gedit_app_get_settings                (GeditApp  *app);
+GeditSettings          *_gedit_app_get_settings                (GeditApp  *app);
 
 GMenuModel             *_gedit_app_get_window_menu             (GeditApp  *app);
 
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 918490a..63b6e92 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -1861,7 +1861,7 @@ _gedit_app_set_default_print_settings (GeditApp         *app,
        priv->print_settings = g_object_ref (settings);
 }
 
-GObject *
+GeditSettings *
 _gedit_app_get_settings (GeditApp *app)
 {
        GeditAppPrivate *priv;
@@ -1870,7 +1870,7 @@ _gedit_app_get_settings (GeditApp *app)
 
        priv = gedit_app_get_instance_private (app);
 
-       return G_OBJECT (priv->settings);
+       return priv->settings;
 }
 
 GMenuModel *
diff --git a/gedit/gedit-preferences-dialog.c b/gedit/gedit-preferences-dialog.c
index 1f8b89d..b598030 100644
--- a/gedit/gedit-preferences-dialog.c
+++ b/gedit/gedit-preferences-dialog.c
@@ -438,7 +438,7 @@ setup_view_page (GeditPreferencesDialog *dlg)
 static void
 setup_font_colors_page_font_section (GeditPreferencesDialog *dlg)
 {
-       GObject *settings;
+       GeditSettings *settings;
        gchar *system_font = NULL;
        gchar *label;
 
@@ -449,7 +449,7 @@ setup_font_colors_page_font_section (GeditPreferencesDialog *dlg)
 
        /* Get values */
        settings = _gedit_app_get_settings (GEDIT_APP (g_application_get_default ()));
-       system_font = gedit_settings_get_system_font (GEDIT_SETTINGS (settings));
+       system_font = gedit_settings_get_system_font (settings);
 
        label = g_strdup_printf(_("_Use the system fixed width font (%s)"),
                                system_font);
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index 3327084..2c3b01d 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -1035,11 +1035,11 @@ gedit_view_set_font (GeditView   *view,
 
        if (default_font)
        {
-               GObject *settings;
+               GeditSettings *settings;
                gchar *font;
 
                settings = _gedit_app_get_settings (GEDIT_APP (g_application_get_default ()));
-               font = gedit_settings_get_system_font (GEDIT_SETTINGS (settings));
+               font = gedit_settings_get_system_font (settings);
 
                font_desc = pango_font_description_from_string (font);
                g_free (font);


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