[grilo-plugins] all: explicitly activate plugins



commit 697caae6e6ac6df2914ca05d78f6e909cb3c7abd
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Thu Dec 10 11:30:57 2015 +0000

    all: explicitly activate plugins
    
    Use the new API to explicitly activate the plugins when required.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759295

 help/examples/example-tmdb.c                       |    7 ++++---
 tests/dleyna/test_dleyna_utils.c                   |    4 +++-
 tests/local-metadata/test_local_metadata.c         |    2 +-
 tests/lua-factory/sources/test_lua_factory_utils.c |    4 +++-
 tests/lua-factory/test_lua_factory_grl_media.c     |    3 ++-
 tests/lua-factory/test_lua_factory_xml_parser.c    |    3 ++-
 tests/spotify-cover/test_spotify_cover.c           |    2 +-
 tests/thetvdb/test_thetvdb_utils.c                 |    6 +++++-
 tests/tmdb/test_tmdb_utils.c                       |    6 +++++-
 tests/vimeo/test_vimeo.c                           |    2 +-
 10 files changed, 27 insertions(+), 12 deletions(-)
---
diff --git a/help/examples/example-tmdb.c b/help/examples/example-tmdb.c
index 9338698..7568948 100644
--- a/help/examples/example-tmdb.c
+++ b/help/examples/example-tmdb.c
@@ -67,14 +67,15 @@ int main (int argc, char *argv[])
   GrlConfig *config = grl_config_new (TMDB_PLUGIN_ID, NULL);
   grl_config_set_api_key (config, TMDB_KEY);
   grl_registry_add_config (reg, config, NULL);
+  grl_registry_load_all_plugins (reg, FALSE, NULL);
 
   /*
    * Get the plugin:
    */
   GError *error = NULL;
-  gboolean plugin_loaded =
-    grl_registry_load_plugin_by_id (reg, TMDB_PLUGIN_ID, &error);
-  g_assert (plugin_loaded);
+  gboolean plugin_activated =
+    grl_registry_activate_plugin_by_id (reg, TMDB_PLUGIN_ID, &error);
+  g_assert (plugin_activated);
   g_assert_no_error (error);
 
   /*
diff --git a/tests/dleyna/test_dleyna_utils.c b/tests/dleyna/test_dleyna_utils.c
index dc616cb..08050db 100644
--- a/tests/dleyna/test_dleyna_utils.c
+++ b/tests/dleyna/test_dleyna_utils.c
@@ -33,7 +33,9 @@ test_dleyna_setup (TestDleynaFixture *fixture,
   g_assert_no_error (error);
 
   fixture->registry = grl_registry_get_default ();
-  grl_registry_load_plugin_by_id (fixture->registry, DLEYNA_PLUGIN_ID, &error);
+  grl_registry_load_plugin (fixture->registry, GRILO_PLUGINS_TESTS_DLEYNA_PLUGIN_PATH "/libgrldleyna.so", 
&error);
+  g_assert_no_error (error);
+  grl_registry_activate_plugin_by_id (fixture->registry, DLEYNA_PLUGIN_ID, &error);
   g_assert_no_error (error);
 
   /* Do not print warning messages, we want to test error conditions without
diff --git a/tests/local-metadata/test_local_metadata.c b/tests/local-metadata/test_local_metadata.c
index 14bd22c..cb64e49 100644
--- a/tests/local-metadata/test_local_metadata.c
+++ b/tests/local-metadata/test_local_metadata.c
@@ -32,7 +32,7 @@ test_setup (void)
   GrlRegistry *registry;
 
   registry = grl_registry_get_default ();
-  grl_registry_load_all_plugins (registry, &error);
+  grl_registry_load_all_plugins (registry, TRUE, &error);
   g_assert_no_error (error);
 }
 
diff --git a/tests/lua-factory/sources/test_lua_factory_utils.c 
b/tests/lua-factory/sources/test_lua_factory_utils.c
index 4fa24b7..f6f36e7 100644
--- a/tests/lua-factory/sources/test_lua_factory_utils.c
+++ b/tests/lua-factory/sources/test_lua_factory_utils.c
@@ -55,7 +55,9 @@ test_lua_factory_setup (GrlConfig *config)
     g_assert_no_error (error);
   }
 
-  grl_registry_load_plugin_by_id (registry, LUA_FACTORY_ID, &error);
+  grl_registry_load_plugin (registry, LUA_FACTORY_PLUGIN_PATH "/libgrlluafactory.so", &error);
+  g_assert_no_error (error);
+  grl_registry_activate_plugin_by_id (registry, LUA_FACTORY_ID, &error);
   g_assert_no_error (error);
 }
 
diff --git a/tests/lua-factory/test_lua_factory_grl_media.c b/tests/lua-factory/test_lua_factory_grl_media.c
index 5dadc92..8759c24 100644
--- a/tests/lua-factory/test_lua_factory_grl_media.c
+++ b/tests/lua-factory/test_lua_factory_grl_media.c
@@ -45,7 +45,8 @@ test_lua_factory_setup (GrlConfig *config)
     g_assert_no_error (error);
   }
 
-  grl_registry_load_plugin_by_id (registry, LUA_FACTORY_ID, &error);
+  grl_registry_load_all_plugins (registry, FALSE, NULL);
+  grl_registry_activate_plugin_by_id (registry, LUA_FACTORY_ID, &error);
   g_assert_no_error (error);
 }
 
diff --git a/tests/lua-factory/test_lua_factory_xml_parser.c b/tests/lua-factory/test_lua_factory_xml_parser.c
index 1af55ef..850bd5b 100644
--- a/tests/lua-factory/test_lua_factory_xml_parser.c
+++ b/tests/lua-factory/test_lua_factory_xml_parser.c
@@ -41,7 +41,8 @@ test_lua_factory_setup (GrlConfig *config)
     g_assert_no_error (error);
   }
 
-  grl_registry_load_plugin_by_id (registry, LUA_FACTORY_ID, &error);
+  grl_registry_load_all_plugins (registry, FALSE, NULL);
+  grl_registry_activate_plugin_by_id (registry, LUA_FACTORY_ID, &error);
   g_assert_no_error (error);
 }
 
diff --git a/tests/spotify-cover/test_spotify_cover.c b/tests/spotify-cover/test_spotify_cover.c
index ca5596c..aef37d7 100644
--- a/tests/spotify-cover/test_spotify_cover.c
+++ b/tests/spotify-cover/test_spotify_cover.c
@@ -44,7 +44,7 @@ test_setup (void)
   GrlRegistry *registry;
 
   registry = grl_registry_get_default ();
-  grl_registry_load_all_plugins (registry, &error);
+  grl_registry_load_all_plugins (registry, TRUE, &error);
   g_assert_no_error (error);
 }
 
diff --git a/tests/thetvdb/test_thetvdb_utils.c b/tests/thetvdb/test_thetvdb_utils.c
index db8f45f..f8e7571 100644
--- a/tests/thetvdb/test_thetvdb_utils.c
+++ b/tests/thetvdb/test_thetvdb_utils.c
@@ -50,7 +50,11 @@ test_setup_thetvdb (void)
   grl_registry_add_config (registry, config, &error);
   g_assert_no_error (error);
 
-  grl_registry_load_plugin_by_id (registry, THETVDB_ID, &error);
+  grl_registry_load_plugin (registry,
+                            THETVDB_PLUGIN_PATH "/libgrlthetvdb.so",
+                            &error);
+  g_assert_no_error (error);
+  grl_registry_activate_plugin_by_id (registry, THETVDB_ID, &error);
   g_assert_no_error (error);
 
   source = GRL_SOURCE (grl_registry_lookup_source (registry, THETVDB_ID));
diff --git a/tests/tmdb/test_tmdb_utils.c b/tests/tmdb/test_tmdb_utils.c
index e5ac405..8d85bde 100644
--- a/tests/tmdb/test_tmdb_utils.c
+++ b/tests/tmdb/test_tmdb_utils.c
@@ -45,7 +45,11 @@ test_setup_tmdb (void)
   grl_registry_add_config (registry, config, &error);
   g_assert_no_error (error);
 
-  grl_registry_load_plugin_by_id (registry, TMDB_PLUGIN_ID, &error);
+  grl_registry_load_plugin (registry,
+                            GRILO_PLUGINS_TESTS_TMDB_PLUGIN_PATH "/libgrltmdb.so",
+                            &error);
+  g_assert_no_error (error);
+  grl_registry_activate_plugin_by_id (registry, TMDB_PLUGIN_ID, &error);
   g_assert_no_error (error);
 
   source = GRL_SOURCE (grl_registry_lookup_source (registry, TMDB_PLUGIN_ID));
diff --git a/tests/vimeo/test_vimeo.c b/tests/vimeo/test_vimeo.c
index 62d0031..3190ebc 100644
--- a/tests/vimeo/test_vimeo.c
+++ b/tests/vimeo/test_vimeo.c
@@ -43,7 +43,7 @@ test_setup (void)
   grl_config_set_api_secret (config, VIMEO_SECRET);
   grl_registry_add_config (registry, config, NULL);
 
-  grl_registry_load_all_plugins (registry, &error);
+  grl_registry_load_all_plugins (registry, TRUE, &error);
   g_assert_no_error (error);
 }
 


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