[gedit] More precise return type for gedit_settings_new()



commit ba5c476f3c03433bfa91d545050fce95adad52c0
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Jun 24 18:01:10 2015 +0200

    More precise return type for gedit_settings_new()
    
    The code is clearer with the right type.

 gedit/gedit-app.c      |    6 +++---
 gedit/gedit-settings.c |    2 +-
 gedit/gedit-settings.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index a079df5..91166e9 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -76,7 +76,7 @@ typedef struct
        GtkPageSetup      *page_setup;
        GtkPrintSettings  *print_settings;
 
-       GObject           *settings;
+       GeditSettings     *settings;
        GSettings         *ui_settings;
        GSettings         *window_settings;
 
@@ -781,7 +781,7 @@ gedit_app_startup (GApplication *application)
        priv->window_settings = g_settings_new ("org.gnome.gedit.state.window");
 
        /* initial lockdown state */
-       priv->lockdown = gedit_settings_get_lockdown (GEDIT_SETTINGS (priv->settings));
+       priv->lockdown = gedit_settings_get_lockdown (priv->settings);
 
        g_action_map_add_action_entries (G_ACTION_MAP (application),
                                         app_entries,
@@ -1869,7 +1869,7 @@ _gedit_app_get_settings (GeditApp *app)
 
        priv = gedit_app_get_instance_private (app);
 
-       return priv->settings;
+       return G_OBJECT (priv->settings);
 }
 
 GMenuModel *
diff --git a/gedit/gedit-settings.c b/gedit/gedit-settings.c
index 08a0d2a..baf8008 100644
--- a/gedit/gedit-settings.c
+++ b/gedit/gedit-settings.c
@@ -388,7 +388,7 @@ gedit_settings_class_init (GeditSettingsClass *klass)
        object_class->dispose = gedit_settings_dispose;
 }
 
-GObject *
+GeditSettings *
 gedit_settings_new ()
 {
        return g_object_new (GEDIT_TYPE_SETTINGS, NULL);
diff --git a/gedit/gedit-settings.h b/gedit/gedit-settings.h
index 16d0d86..b12404c 100644
--- a/gedit/gedit-settings.h
+++ b/gedit/gedit-settings.h
@@ -34,7 +34,7 @@ G_BEGIN_DECLS
 
 G_DECLARE_FINAL_TYPE (GeditSettings, gedit_settings, GEDIT, SETTINGS, GObject)
 
-GObject                        *gedit_settings_new                             (void);
+GeditSettings          *gedit_settings_new                             (void);
 
 GeditLockdownMask       gedit_settings_get_lockdown                    (GeditSettings *gs);
 


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