[grilo-plugins] [filesystem] Refactor code



commit 122b2e56b0a0a9d14adebd523064e2450571e1a3
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Thu Jun 10 21:12:46 2010 +0200

    [filesystem] Refactor code
    
    Move finalize() function so all gobject-related functions are together.

 src/filesystem/grl-filesystem.c |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/src/filesystem/grl-filesystem.c b/src/filesystem/grl-filesystem.c
index 6e0d95d..d74f19a 100644
--- a/src/filesystem/grl-filesystem.c
+++ b/src/filesystem/grl-filesystem.c
@@ -91,6 +91,8 @@ typedef struct {
 
 static GrlFilesystemSource *grl_filesystem_source_new (void);
 
+static void grl_filesystem_source_finalize (GObject *object);
+
 gboolean grl_filesystem_plugin_init (GrlPluginRegistry *registry,
                                      const GrlPluginInfo *plugin,
                                      GList *configs);
@@ -103,8 +105,6 @@ static void grl_filesystem_source_metadata (GrlMediaSource *source,
 static void grl_filesystem_source_browse (GrlMediaSource *source,
                                           GrlMediaSourceBrowseSpec *bs);
 
-static void grl_filesystem_source_finalize (GObject *object);
-
 /* =================== Filesystem Plugin  =============== */
 
 gboolean
@@ -148,6 +148,11 @@ GRL_PLUGIN_REGISTER (grl_filesystem_plugin_init,
 
 /* ================== Filesystem GObject ================ */
 
+
+G_DEFINE_TYPE (GrlFilesystemSource,
+               grl_filesystem_source,
+               GRL_TYPE_MEDIA_SOURCE);
+
 static GrlFilesystemSource *
 grl_filesystem_source_new (void)
 {
@@ -177,9 +182,14 @@ grl_filesystem_source_init (GrlFilesystemSource *source)
   source->priv = GRL_FILESYSTEM_SOURCE_GET_PRIVATE (source);
 }
 
-G_DEFINE_TYPE (GrlFilesystemSource,
-               grl_filesystem_source,
-               GRL_TYPE_MEDIA_SOURCE);
+static void
+grl_filesystem_source_finalize (GObject *object)
+{
+  GrlFilesystemSource *filesystem_source = GRL_FILESYSTEM_SOURCE (object);
+  g_list_foreach (filesystem_source->priv->chosen_paths, (GFunc) g_free, NULL);
+  g_list_free (filesystem_source->priv->chosen_paths);
+  G_OBJECT_CLASS (grl_filesystem_source_parent_class)->finalize (object);
+}
 
 /* ======================= Utilities ==================== */
 
@@ -620,12 +630,3 @@ grl_filesystem_source_metadata (GrlMediaSource *source,
     g_error_free (error);
   }
 }
-
-static void
-grl_filesystem_source_finalize (GObject *object)
-{
-  GrlFilesystemSource *filesystem_source = GRL_FILESYSTEM_SOURCE (object);
-  g_list_foreach (filesystem_source->priv->chosen_paths, (GFunc) g_free, NULL);
-  g_list_free (filesystem_source->priv->chosen_paths);
-  G_OBJECT_CLASS (grl_filesystem_source_parent_class)->finalize (object);
-}



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