[grilo-plugins] thetvdb: Use new register_keys vfunc



commit af89bc4c3f881b3781be9b369eef714f52dd07cc
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Dec 2 12:18:10 2014 +0100

    thetvdb: Use new register_keys vfunc
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740943

 src/thetvdb/grl-thetvdb.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/src/thetvdb/grl-thetvdb.c b/src/thetvdb/grl-thetvdb.c
index ec26f6a..8b81a84 100644
--- a/src/thetvdb/grl-thetvdb.c
+++ b/src/thetvdb/grl-thetvdb.c
@@ -189,7 +189,6 @@ grl_thetvdb_plugin_init (GrlRegistry *registry,
                          GList *configs)
 {
   GrlTheTVDBSource *source;
-  GParamSpec *spec;
   GrlConfig *config;
   char *api_key = NULL;
 
@@ -207,6 +206,21 @@ grl_thetvdb_plugin_init (GrlRegistry *registry,
     return FALSE;
   }
 
+  source = grl_thetvdb_source_new (api_key);
+  grl_registry_register_source (registry,
+                                plugin,
+                                GRL_SOURCE (source),
+                                NULL);
+  g_free (api_key);
+  return TRUE;
+}
+
+static void
+grl_thetvdb_plugin_register_keys (GrlRegistry *registry,
+                                  GrlPlugin   *plugin)
+{
+  GParamSpec *spec;
+
   spec = g_param_spec_string ("thetvdb-id",
                               "thetvdb-id",
                               "TV Show or episode id for The TVDB source.",
@@ -270,17 +284,9 @@ grl_thetvdb_plugin_init (GrlRegistry *registry,
                               G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE),
   GRL_THETVDB_METADATA_KEY_EPISODE_SS =
     grl_registry_register_metadata_key (registry, spec, NULL);
-
-  source = grl_thetvdb_source_new (api_key);
-  grl_registry_register_source (registry,
-                                plugin,
-                                GRL_SOURCE (source),
-                                NULL);
-  g_free (api_key);
-  return TRUE;
 }
 
-GRL_PLUGIN_REGISTER (grl_thetvdb_plugin_init, NULL, SOURCE_ID);
+GRL_PLUGIN_REGISTER_FULL (grl_thetvdb_plugin_init, NULL, grl_thetvdb_plugin_register_keys, SOURCE_ID);
 
 /* ================== TheTVDB GObject ================= */
 


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