[gnome-software] trivial: Reorder functions



commit bb1bba57dc08a8add800c027838011c079f5f908
Author: Kalev Lember <kalevlember gmail com>
Date:   Sun Jun 7 12:48:17 2015 +0200

    trivial: Reorder functions
    
    Reorder the finalize() and class_init() functions to make it possible to
    drop the finalize() prototypes at the top of the files. No other changes
    in this commit besides moving code around.

 src/gs-app.c             |   98 ++++++++++++++++++++++-----------------------
 src/gs-category.c        |   28 ++++++-------
 src/gs-folders.c         |   34 +++++++--------
 src/gs-language.c        |    2 -
 src/gs-plugin-loader.c   |   80 ++++++++++++++++++-------------------
 src/gs-profile.c         |   34 +++++++--------
 src/gs-shell-details.c   |   42 +++++++++----------
 src/gs-shell-installed.c |   40 +++++++++----------
 src/gs-shell-search.c    |   52 ++++++++++++-------------
 src/gs-shell-updates.c   |   50 +++++++++++------------
 src/gs-shell.c           |   36 ++++++++---------
 src/gs-vendor.c          |   26 ++++++-------
 12 files changed, 249 insertions(+), 273 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 2fad5d1..52db1a2 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -51,8 +51,6 @@
 #include "gs-cleanup.h"
 #include "gs-utils.h"
 
-static void    gs_app_finalize (GObject        *object);
-
 struct GsAppPrivate
 {
        gchar                   *id;
@@ -2090,6 +2088,54 @@ gs_app_set_property (GObject *object, guint prop_id, const GValue *value, GParam
 }
 
 /**
+ * gs_app_finalize:
+ * @object: The object to finalize
+ **/
+static void
+gs_app_finalize (GObject *object)
+{
+       GsApp *app = GS_APP (object);
+       GsAppPrivate *priv = APP_PRIV (app);
+
+       g_free (priv->id);
+       g_free (priv->name);
+       g_hash_table_unref (priv->urls);
+       g_free (priv->licence);
+       g_free (priv->menu_path);
+       g_free (priv->origin);
+       g_ptr_array_unref (priv->sources);
+       g_ptr_array_unref (priv->source_ids);
+       g_free (priv->project_group);
+       g_free (priv->version);
+       g_free (priv->version_ui);
+       g_free (priv->summary);
+       g_free (priv->summary_missing);
+       g_free (priv->description);
+       g_ptr_array_unref (priv->screenshots);
+       g_free (priv->update_version);
+       g_free (priv->update_version_ui);
+       g_free (priv->update_details);
+       g_free (priv->management_plugin);
+       g_hash_table_unref (priv->metadata);
+       g_hash_table_unref (priv->addons_hash);
+       g_ptr_array_unref (priv->addons);
+       g_hash_table_unref (priv->related_hash);
+       g_ptr_array_unref (priv->related);
+       g_ptr_array_unref (priv->history);
+       if (priv->icon != NULL)
+               g_object_unref (priv->icon);
+       if (priv->pixbuf != NULL)
+               g_object_unref (priv->pixbuf);
+       if (priv->featured_pixbuf != NULL)
+               g_object_unref (priv->featured_pixbuf);
+       g_ptr_array_unref (priv->categories);
+       if (priv->keywords != NULL)
+               g_ptr_array_unref (priv->keywords);
+
+       G_OBJECT_CLASS (gs_app_parent_class)->finalize (object);
+}
+
+/**
  * gs_app_class_init:
  * @klass: The GsAppClass
  **/
@@ -2210,54 +2256,6 @@ gs_app_init (GsApp *app)
 }
 
 /**
- * gs_app_finalize:
- * @object: The object to finalize
- **/
-static void
-gs_app_finalize (GObject *object)
-{
-       GsApp *app = GS_APP (object);
-       GsAppPrivate *priv = APP_PRIV (app);
-
-       g_free (priv->id);
-       g_free (priv->name);
-       g_hash_table_unref (priv->urls);
-       g_free (priv->licence);
-       g_free (priv->menu_path);
-       g_free (priv->origin);
-       g_ptr_array_unref (priv->sources);
-       g_ptr_array_unref (priv->source_ids);
-       g_free (priv->project_group);
-       g_free (priv->version);
-       g_free (priv->version_ui);
-       g_free (priv->summary);
-       g_free (priv->summary_missing);
-       g_free (priv->description);
-       g_ptr_array_unref (priv->screenshots);
-       g_free (priv->update_version);
-       g_free (priv->update_version_ui);
-       g_free (priv->update_details);
-       g_free (priv->management_plugin);
-       g_hash_table_unref (priv->metadata);
-       g_hash_table_unref (priv->addons_hash);
-       g_ptr_array_unref (priv->addons);
-       g_hash_table_unref (priv->related_hash);
-       g_ptr_array_unref (priv->related);
-       g_ptr_array_unref (priv->history);
-       if (priv->icon != NULL)
-               g_object_unref (priv->icon);
-       if (priv->pixbuf != NULL)
-               g_object_unref (priv->pixbuf);
-       if (priv->featured_pixbuf != NULL)
-               g_object_unref (priv->featured_pixbuf);
-       g_ptr_array_unref (priv->categories);
-       if (priv->keywords != NULL)
-               g_ptr_array_unref (priv->keywords);
-
-       G_OBJECT_CLASS (gs_app_parent_class)->finalize (object);
-}
-
-/**
  * gs_app_new:
  *
  * Return value: a new GsApp object.
diff --git a/src/gs-category.c b/src/gs-category.c
index bc656dc..cdc6d9a 100644
--- a/src/gs-category.c
+++ b/src/gs-category.c
@@ -26,8 +26,6 @@
 
 #include "gs-category.h"
 
-static void    gs_category_finalize    (GObject        *object);
-
 struct GsCategoryPrivate
 {
        gchar           *id;
@@ -180,19 +178,6 @@ gs_category_sort_subcategories (GsCategory *category)
 }
 
 static void
-gs_category_class_init (GsCategoryClass *klass)
-{
-       GObjectClass *object_class = G_OBJECT_CLASS (klass);
-       object_class->finalize = gs_category_finalize;
-}
-
-static void
-gs_category_init (GsCategory *category)
-{
-       category->priv = gs_category_get_instance_private (category);
-}
-
-static void
 gs_category_finalize (GObject *object)
 {
        GsCategory *category = GS_CATEGORY (object);
@@ -208,6 +193,19 @@ gs_category_finalize (GObject *object)
        G_OBJECT_CLASS (gs_category_parent_class)->finalize (object);
 }
 
+static void
+gs_category_class_init (GsCategoryClass *klass)
+{
+       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+       object_class->finalize = gs_category_finalize;
+}
+
+static void
+gs_category_init (GsCategory *category)
+{
+       category->priv = gs_category_get_instance_private (category);
+}
+
 GsCategory *
 gs_category_new (GsCategory *parent, const gchar *id, const gchar *name)
 {
diff --git a/src/gs-folders.c b/src/gs-folders.c
index ebb7ca2..fa8edae 100644
--- a/src/gs-folders.c
+++ b/src/gs-folders.c
@@ -31,8 +31,6 @@
 #define APP_FOLDER_SCHEMA       "org.gnome.desktop.app-folders"
 #define APP_FOLDER_CHILD_SCHEMA "org.gnome.desktop.app-folders.folder"
 
-static void    gs_folders_finalize     (GObject        *object);
-
 /* We are loading folders from a settings with type
  * a{sas}, which maps folder ids to list of app ids.
  *
@@ -167,13 +165,6 @@ gs_folder_free (GsFolder *folder)
 }
 
 static void
-gs_folders_class_init (GsFoldersClass *klass)
-{
-       GObjectClass *object_class = G_OBJECT_CLASS (klass);
-       object_class->finalize = gs_folders_finalize;
-}
-
-static void
 load (GsFolders *folders)
 {
        GsFolder *folder;
@@ -284,15 +275,6 @@ clear (GsFolders *folders)
 }
 
 static void
-gs_folders_init (GsFolders *folders)
-{
-       folders->priv = gs_folders_get_instance_private (folders);
-
-       folders->priv->settings = g_settings_new (APP_FOLDER_SCHEMA);
-       load (folders);
-}
-
-static void
 gs_folders_finalize (GObject *object)
 {
        GsFolders *folders = GS_FOLDERS (object);
@@ -303,6 +285,22 @@ gs_folders_finalize (GObject *object)
        G_OBJECT_CLASS (gs_folders_parent_class)->finalize (object);
 }
 
+static void
+gs_folders_class_init (GsFoldersClass *klass)
+{
+       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+       object_class->finalize = gs_folders_finalize;
+}
+
+static void
+gs_folders_init (GsFolders *folders)
+{
+       folders->priv = gs_folders_get_instance_private (folders);
+
+       folders->priv->settings = g_settings_new (APP_FOLDER_SCHEMA);
+       load (folders);
+}
+
 static GsFolders *
 gs_folders_new (void)
 {
diff --git a/src/gs-language.c b/src/gs-language.c
index 76c5fbc..614fedc 100644
--- a/src/gs-language.c
+++ b/src/gs-language.c
@@ -26,8 +26,6 @@
 
 #include "gs-language.h"
 
-static void     gs_language_finalize   (GObject          *object);
-
 #define GS_LANGUAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GS_TYPE_LANGUAGE, GsLanguagePrivate))
 
 struct GsLanguagePrivate
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 80493ac..559ce44 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -31,8 +31,6 @@
 
 #define GS_PLUGIN_LOADER_UPDATES_CHANGED_DELAY 3       /* s */
 
-static void    gs_plugin_loader_finalize       (GObject        *object);
-
 struct GsPluginLoaderPrivate
 {
        GPtrArray               *plugins;
@@ -3054,6 +3052,45 @@ gs_plugin_loader_plugin_free (GsPlugin *plugin)
 }
 
 /**
+ * gs_plugin_loader_finalize:
+ * @object: The object to finalize
+ **/
+static void
+gs_plugin_loader_finalize (GObject *object)
+{
+       GsPluginLoader *plugin_loader;
+
+       g_return_if_fail (object != NULL);
+       g_return_if_fail (GS_IS_PLUGIN_LOADER (object));
+
+       plugin_loader = GS_PLUGIN_LOADER (object);
+
+       g_return_if_fail (plugin_loader->priv != NULL);
+
+       if (plugin_loader->priv->updates_changed_id != 0)
+               g_source_remove (plugin_loader->priv->updates_changed_id);
+
+       /* application stop */
+       gs_profile_stop (plugin_loader->priv->profile, "GsPluginLoader");
+
+       /* run the plugins */
+       gs_plugin_loader_run (plugin_loader, "gs_plugin_destroy");
+
+       g_object_unref (plugin_loader->priv->settings);
+       g_object_unref (plugin_loader->priv->profile);
+       g_strfreev (plugin_loader->priv->compatible_projects);
+       g_hash_table_unref (plugin_loader->priv->app_cache);
+       g_ptr_array_unref (plugin_loader->priv->pending_apps);
+       g_ptr_array_unref (plugin_loader->priv->plugins);
+       g_free (plugin_loader->priv->location);
+
+       g_mutex_clear (&plugin_loader->priv->pending_apps_mutex);
+       g_mutex_clear (&plugin_loader->priv->app_cache_mutex);
+
+       G_OBJECT_CLASS (gs_plugin_loader_parent_class)->finalize (object);
+}
+
+/**
  * gs_plugin_loader_class_init:
  * @klass: The GsPluginLoaderClass
  **/
@@ -3126,45 +3163,6 @@ gs_plugin_loader_init (GsPluginLoader *plugin_loader)
 }
 
 /**
- * gs_plugin_loader_finalize:
- * @object: The object to finalize
- **/
-static void
-gs_plugin_loader_finalize (GObject *object)
-{
-       GsPluginLoader *plugin_loader;
-
-       g_return_if_fail (object != NULL);
-       g_return_if_fail (GS_IS_PLUGIN_LOADER (object));
-
-       plugin_loader = GS_PLUGIN_LOADER (object);
-
-       g_return_if_fail (plugin_loader->priv != NULL);
-
-       if (plugin_loader->priv->updates_changed_id != 0)
-               g_source_remove (plugin_loader->priv->updates_changed_id);
-
-       /* application stop */
-       gs_profile_stop (plugin_loader->priv->profile, "GsPluginLoader");
-
-       /* run the plugins */
-       gs_plugin_loader_run (plugin_loader, "gs_plugin_destroy");
-
-       g_object_unref (plugin_loader->priv->settings);
-       g_object_unref (plugin_loader->priv->profile);
-       g_strfreev (plugin_loader->priv->compatible_projects);
-       g_hash_table_unref (plugin_loader->priv->app_cache);
-       g_ptr_array_unref (plugin_loader->priv->pending_apps);
-       g_ptr_array_unref (plugin_loader->priv->plugins);
-       g_free (plugin_loader->priv->location);
-
-       g_mutex_clear (&plugin_loader->priv->pending_apps_mutex);
-       g_mutex_clear (&plugin_loader->priv->app_cache_mutex);
-
-       G_OBJECT_CLASS (gs_plugin_loader_parent_class)->finalize (object);
-}
-
-/**
  * gs_plugin_loader_new:
  *
  * Return value: a new GsPluginLoader object.
diff --git a/src/gs-profile.c b/src/gs-profile.c
index 859197b..20a03b6 100644
--- a/src/gs-profile.c
+++ b/src/gs-profile.c
@@ -26,8 +26,6 @@
 #include "gs-cleanup.h"
 #include "gs-profile.h"
 
-static void    gs_profile_finalize     (GObject        *object);
-
 struct GsProfilePrivate
 {
        GPtrArray       *current;
@@ -255,6 +253,22 @@ gs_profile_dump (GsProfile *profile)
 }
 
 /**
+ * gs_profile_finalize:
+ **/
+static void
+gs_profile_finalize (GObject *object)
+{
+       GsProfile *profile = GS_PROFILE (object);
+       GsProfilePrivate *priv = profile->priv;
+
+       g_ptr_array_foreach (priv->current, (GFunc) gs_profile_item_free, NULL);
+       g_ptr_array_unref (priv->current);
+       g_ptr_array_unref (priv->archived);
+
+       G_OBJECT_CLASS (gs_profile_parent_class)->finalize (object);
+}
+
+/**
  * gs_profile_class_init:
  **/
 static void
@@ -278,22 +292,6 @@ gs_profile_init (GsProfile *profile)
 }
 
 /**
- * gs_profile_finalize:
- **/
-static void
-gs_profile_finalize (GObject *object)
-{
-       GsProfile *profile = GS_PROFILE (object);
-       GsProfilePrivate *priv = profile->priv;
-
-       g_ptr_array_foreach (priv->current, (GFunc) gs_profile_item_free, NULL);
-       g_ptr_array_unref (priv->current);
-       g_ptr_array_unref (priv->archived);
-
-       G_OBJECT_CLASS (gs_profile_parent_class)->finalize (object);
-}
-
-/**
  * gs_profile_new:
  **/
 GsProfile *
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index d5d2fbc..9b27fc0 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -36,8 +36,6 @@
 #include "gs-screenshot-image.h"
 #include "gs-star-widget.h"
 
-static void    gs_shell_details_finalize       (GObject        *object);
-
 typedef enum {
        GS_SHELL_DETAILS_STATE_LOADING,
        GS_SHELL_DETAILS_STATE_READY
@@ -1247,6 +1245,26 @@ gs_shell_details_setup (GsShellDetails *shell_details,
 }
 
 /**
+ * gs_shell_details_finalize:
+ **/
+static void
+gs_shell_details_finalize (GObject *object)
+{
+       GsShellDetails *shell_details = GS_SHELL_DETAILS (object);
+       GsShellDetailsPrivate *priv = shell_details->priv;
+
+       g_object_unref (priv->builder);
+       g_object_unref (priv->plugin_loader);
+       g_object_unref (priv->cancellable);
+       if (priv->app != NULL)
+               g_object_unref (priv->app);
+       if (priv->session != NULL)
+               g_object_unref (priv->session);
+
+       G_OBJECT_CLASS (gs_shell_details_parent_class)->finalize (object);
+}
+
+/**
  * gs_shell_details_class_init:
  **/
 static void
@@ -1327,26 +1345,6 @@ gs_shell_details_init (GsShellDetails *shell_details)
 }
 
 /**
- * gs_shell_details_finalize:
- **/
-static void
-gs_shell_details_finalize (GObject *object)
-{
-       GsShellDetails *shell_details = GS_SHELL_DETAILS (object);
-       GsShellDetailsPrivate *priv = shell_details->priv;
-
-       g_object_unref (priv->builder);
-       g_object_unref (priv->plugin_loader);
-       g_object_unref (priv->cancellable);
-       if (priv->app != NULL)
-               g_object_unref (priv->app);
-       if (priv->session != NULL)
-               g_object_unref (priv->session);
-
-       G_OBJECT_CLASS (gs_shell_details_parent_class)->finalize (object);
-}
-
-/**
  * gs_shell_details_new:
  **/
 GsShellDetails *
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index e079e83..f38bf1f 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -35,8 +35,6 @@
 #include "gs-app-folder-dialog.h"
 #include "gs-folders.h"
 
-static void    gs_shell_installed_finalize     (GObject        *object);
-
 struct GsShellInstalledPrivate
 {
        GsPluginLoader          *plugin_loader;
@@ -763,6 +761,25 @@ gs_shell_installed_setup (GsShellInstalled *shell_installed,
 }
 
 /**
+ * gs_shell_installed_finalize:
+ **/
+static void
+gs_shell_installed_finalize (GObject *object)
+{
+       GsShellInstalled *shell_installed = GS_SHELL_INSTALLED (object);
+       GsShellInstalledPrivate *priv = shell_installed->priv;
+
+       g_object_unref (priv->sizegroup_image);
+       g_object_unref (priv->sizegroup_name);
+
+       g_object_unref (priv->builder);
+       g_object_unref (priv->plugin_loader);
+       g_object_unref (priv->cancellable);
+
+       G_OBJECT_CLASS (gs_shell_installed_parent_class)->finalize (object);
+}
+
+/**
  * gs_shell_installed_class_init:
  **/
 static void
@@ -801,25 +818,6 @@ gs_shell_installed_init (GsShellInstalled *shell_installed)
 }
 
 /**
- * gs_shell_installed_finalize:
- **/
-static void
-gs_shell_installed_finalize (GObject *object)
-{
-       GsShellInstalled *shell_installed = GS_SHELL_INSTALLED (object);
-       GsShellInstalledPrivate *priv = shell_installed->priv;
-
-       g_object_unref (priv->sizegroup_image);
-       g_object_unref (priv->sizegroup_name);
-
-       g_object_unref (priv->builder);
-       g_object_unref (priv->plugin_loader);
-       g_object_unref (priv->cancellable);
-
-       G_OBJECT_CLASS (gs_shell_installed_parent_class)->finalize (object);
-}
-
-/**
  * gs_shell_installed_new:
  **/
 GsShellInstalled *
diff --git a/src/gs-shell-search.c b/src/gs-shell-search.c
index ceaec7e..a1f2ee6 100644
--- a/src/gs-shell-search.c
+++ b/src/gs-shell-search.c
@@ -31,8 +31,6 @@
 #include "gs-utils.h"
 #include "gs-app-row.h"
 
-static void    gs_shell_search_finalize        (GObject        *object);
-
 struct GsShellSearchPrivate
 {
        GsPluginLoader          *plugin_loader;
@@ -408,6 +406,31 @@ gs_shell_search_setup (GsShellSearch *shell_search,
 }
 
 /**
+ * gs_shell_search_finalize:
+ **/
+static void
+gs_shell_search_finalize (GObject *object)
+{
+       GsShellSearch *shell_search = GS_SHELL_SEARCH (object);
+       GsShellSearchPrivate *priv = shell_search->priv;
+
+       g_object_unref (priv->sizegroup_image);
+       g_object_unref (priv->sizegroup_name);
+
+       g_object_unref (priv->builder);
+       g_object_unref (priv->plugin_loader);
+       g_object_unref (priv->cancellable);
+
+       if (priv->search_cancellable != NULL)
+               g_object_unref (priv->search_cancellable);
+
+       g_free (priv->appid_to_show);
+       g_free (priv->value);
+
+       G_OBJECT_CLASS (gs_shell_search_parent_class)->finalize (object);
+}
+
+/**
  * gs_shell_search_class_init:
  **/
 static void
@@ -443,31 +466,6 @@ gs_shell_search_init (GsShellSearch *shell_search)
 }
 
 /**
- * gs_shell_search_finalize:
- **/
-static void
-gs_shell_search_finalize (GObject *object)
-{
-       GsShellSearch *shell_search = GS_SHELL_SEARCH (object);
-       GsShellSearchPrivate *priv = shell_search->priv;
-
-       g_object_unref (priv->sizegroup_image);
-       g_object_unref (priv->sizegroup_name);
-
-       g_object_unref (priv->builder);
-       g_object_unref (priv->plugin_loader);
-       g_object_unref (priv->cancellable);
-
-       if (priv->search_cancellable != NULL)
-               g_object_unref (priv->search_cancellable);
-
-       g_free (priv->appid_to_show);
-       g_free (priv->value);
-
-       G_OBJECT_CLASS (gs_shell_search_parent_class)->finalize (object);
-}
-
-/**
  * gs_shell_search_new:
  **/
 GsShellSearch *
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index c1c15be..6794d92 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -38,8 +38,6 @@
 #include <gdesktop-enums.h>
 #include <langinfo.h>
 
-static void    gs_shell_updates_finalize       (GObject        *object);
-
 typedef enum {
        GS_SHELL_UPDATES_STATE_STARTUP,
        GS_SHELL_UPDATES_STATE_ACTION_REFRESH_NO_UPDATES,
@@ -962,6 +960,30 @@ gs_shell_updates_setup (GsShellUpdates *shell_updates,
 }
 
 /**
+ * gs_shell_updates_finalize:
+ **/
+static void
+gs_shell_updates_finalize (GObject *object)
+{
+       GsShellUpdates *shell_updates = GS_SHELL_UPDATES (object);
+       GsShellUpdatesPrivate *priv = shell_updates->priv;
+
+       if (priv->cancellable_refresh != NULL) {
+               g_cancellable_cancel (priv->cancellable_refresh);
+               g_object_unref (priv->cancellable_refresh);
+       }
+
+       g_object_unref (priv->builder);
+       g_object_unref (priv->plugin_loader);
+       g_object_unref (priv->cancellable);
+       g_object_unref (priv->control);
+       g_object_unref (priv->settings);
+       g_object_unref (priv->desktop_settings);
+
+       G_OBJECT_CLASS (gs_shell_updates_parent_class)->finalize (object);
+}
+
+/**
  * gs_shell_updates_class_init:
  **/
 static void
@@ -1007,30 +1029,6 @@ gs_shell_updates_init (GsShellUpdates *shell_updates)
 }
 
 /**
- * gs_shell_updates_finalize:
- **/
-static void
-gs_shell_updates_finalize (GObject *object)
-{
-       GsShellUpdates *shell_updates = GS_SHELL_UPDATES (object);
-       GsShellUpdatesPrivate *priv = shell_updates->priv;
-
-       if (priv->cancellable_refresh != NULL) {
-               g_cancellable_cancel (priv->cancellable_refresh);
-               g_object_unref (priv->cancellable_refresh);
-       }
-
-       g_object_unref (priv->builder);
-       g_object_unref (priv->plugin_loader);
-       g_object_unref (priv->cancellable);
-       g_object_unref (priv->control);
-       g_object_unref (priv->settings);
-       g_object_unref (priv->desktop_settings);
-
-       G_OBJECT_CLASS (gs_shell_updates_parent_class)->finalize (object);
-}
-
-/**
  * gs_shell_updates_new:
  **/
 GsShellUpdates *
diff --git a/src/gs-shell.c b/src/gs-shell.c
index d2a3898..0da7d26 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -48,8 +48,6 @@ static const gchar *page_name[] = {
        "extras",
 };
 
-static void    gs_shell_finalize       (GObject        *object);
-
 typedef struct {
        GsShellMode      mode;
        GtkWidget       *focus;
@@ -773,6 +771,23 @@ gs_shell_show_details (GsShell *shell, const gchar *id)
 }
 
 /**
+ * gs_shell_finalize:
+ **/
+static void
+gs_shell_finalize (GObject *object)
+{
+       GsShell *shell = GS_SHELL (object);
+       GsShellPrivate *priv = shell->priv;
+
+       g_queue_free_full (priv->back_entry_stack, (GDestroyNotify) free_back_entry);
+       g_object_unref (priv->builder);
+       g_object_unref (priv->cancellable);
+       g_object_unref (priv->plugin_loader);
+
+       G_OBJECT_CLASS (gs_shell_parent_class)->finalize (object);
+}
+
+/**
  * gs_shell_class_init:
  **/
 static void
@@ -801,23 +816,6 @@ gs_shell_init (GsShell *shell)
 }
 
 /**
- * gs_shell_finalize:
- **/
-static void
-gs_shell_finalize (GObject *object)
-{
-       GsShell *shell = GS_SHELL (object);
-       GsShellPrivate *priv = shell->priv;
-
-       g_queue_free_full (priv->back_entry_stack, (GDestroyNotify) free_back_entry);
-       g_object_unref (priv->builder);
-       g_object_unref (priv->cancellable);
-       g_object_unref (priv->plugin_loader);
-
-       G_OBJECT_CLASS (gs_shell_parent_class)->finalize (object);
-}
-
-/**
  * gs_shell_new:
  **/
 GsShell *
diff --git a/src/gs-vendor.c b/src/gs-vendor.c
index f279a3c..59c4985 100644
--- a/src/gs-vendor.c
+++ b/src/gs-vendor.c
@@ -25,8 +25,6 @@
 
 #include "gs-vendor.h"
 
-static void     gs_vendor_finalize     (GObject          *object);
-
 #define GS_VENDOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GS_TYPE_VENDOR, GsVendorPrivate))
 
 struct GsVendorPrivate
@@ -37,18 +35,6 @@ struct GsVendorPrivate
 G_DEFINE_TYPE (GsVendor, gs_vendor, G_TYPE_OBJECT)
 
 /**
- * gs_vendor_class_init:
- * @klass: The GsVendorClass
- **/
-static void
-gs_vendor_class_init (GsVendorClass *klass)
-{
-       GObjectClass *object_class = G_OBJECT_CLASS (klass);
-       object_class->finalize = gs_vendor_finalize;
-       g_type_class_add_private (klass, sizeof (GsVendorPrivate));
-}
-
-/**
  * gs_vendor_type_to_string:
  **/
 static const gchar *
@@ -144,6 +130,18 @@ gs_vendor_finalize (GObject *object)
 }
 
 /**
+ * gs_vendor_class_init:
+ * @klass: The GsVendorClass
+ **/
+static void
+gs_vendor_class_init (GsVendorClass *klass)
+{
+       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+       object_class->finalize = gs_vendor_finalize;
+       g_type_class_add_private (klass, sizeof (GsVendorPrivate));
+}
+
+/**
  * gs_vendor_new:
  *
  * Return value: a new GsVendor object.


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