[grilo] core: Rename some registry functions
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: Rename some registry functions
- Date: Mon, 6 Aug 2012 16:51:12 +0000 (UTC)
commit b3be0e0f4c1543c8e2372fbc43cd238868afcd2e
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Mon Jul 23 13:59:35 2012 +0000
core: Rename some registry functions
Rename those registry functions affecting plugins, by adding the word "plugin".
It makes clear what the functions are about.
doc/grilo/grilo-sections.txt | 10 +++---
doc/grilo/writing-apps.xml | 2 +-
examples/browsing.c | 2 +-
examples/configuring-plugins.c | 2 +-
examples/efficient-metadata-resolution.c | 2 +-
examples/loading-plugins.c | 2 +-
examples/multivalues.c | 2 +-
examples/searching.c | 2 +-
src/grl-registry.c | 56 +++++++++++++++---------------
src/grl-registry.h | 28 +++++++-------
tests/metadata_source.c | 2 +-
tests/registry.c | 2 +-
tools/grilo-inspect/grl-inspect.c | 2 +-
tools/grilo-test-ui/main.c | 10 +++---
tools/vala/grilo-test.vala | 2 +-
15 files changed, 63 insertions(+), 63 deletions(-)
---
diff --git a/doc/grilo/grilo-sections.txt b/doc/grilo/grilo-sections.txt
index dfd2baa..64d8230 100644
--- a/doc/grilo/grilo-sections.txt
+++ b/doc/grilo/grilo-sections.txt
@@ -171,11 +171,11 @@ GrlRegistry
GrlRegistryClass
grl_registry_get_default
grl_registry_add_directory
-grl_registry_load
-grl_registry_load_directory
-grl_registry_unload
-grl_registry_load_all
-grl_registry_load_by_id
+grl_registry_load_plugin
+grl_registry_load_plugin_directory
+grl_registry_unload_plugin
+grl_registry_load_all_plugins
+grl_registry_load_plugin_by_id
grl_registry_register_source
grl_registry_unregister_source
grl_registry_lookup_source
diff --git a/doc/grilo/writing-apps.xml b/doc/grilo/writing-apps.xml
index 1321b31..0e96ac8 100644
--- a/doc/grilo/writing-apps.xml
+++ b/doc/grilo/writing-apps.xml
@@ -64,7 +64,7 @@
<para>
You can instruct Grilo to load all available plugins via
- <link linkend="grl-registry-load-all">grl_registry_load_all()</link>.
+ <link linkend="grl-registry-load-all-plugins">grl_registry_load_all_plugins()</link>.
This will look into the default
installation directory for the plugins and also the paths
included via the environment variable GRL_PLUGIN_PATH.
diff --git a/examples/browsing.c b/examples/browsing.c
index 38bd0c4..6c59a86 100644
--- a/examples/browsing.c
+++ b/examples/browsing.c
@@ -118,7 +118,7 @@ load_plugins (void)
registry = grl_registry_get_default ();
g_signal_connect (registry, "source-added",
G_CALLBACK (source_added_cb), NULL);
- if (!grl_registry_load_all (registry, &error)) {
+ if (!grl_registry_load_all_plugins (registry, &error)) {
g_error ("Failed to load plugins: %s", error->message);
}
}
diff --git a/examples/configuring-plugins.c b/examples/configuring-plugins.c
index 03bf9d8..40d504d 100644
--- a/examples/configuring-plugins.c
+++ b/examples/configuring-plugins.c
@@ -28,7 +28,7 @@ load_plugins (void)
g_signal_connect (registry, "source-added",
G_CALLBACK (source_added_cb), NULL);
- if (!grl_registry_load_all (registry, &error)) {
+ if (!grl_registry_load_all_plugins (registry, &error)) {
g_error ("Failed to load plugins: %s", error->message);
}
}
diff --git a/examples/efficient-metadata-resolution.c b/examples/efficient-metadata-resolution.c
index 907bc68..c99b037 100644
--- a/examples/efficient-metadata-resolution.c
+++ b/examples/efficient-metadata-resolution.c
@@ -137,7 +137,7 @@ load_plugins (void)
registry = grl_registry_get_default ();
g_signal_connect (registry, "source-added",
G_CALLBACK (source_added_cb), NULL);
- if (!grl_registry_load_all (registry, &error)) {
+ if (!grl_registry_load_all_plugins (registry, &error)) {
g_error ("Failed to load plugins: %s", error->message);
}
}
diff --git a/examples/loading-plugins.c b/examples/loading-plugins.c
index 001ce9e..9893c36 100644
--- a/examples/loading-plugins.c
+++ b/examples/loading-plugins.c
@@ -49,7 +49,7 @@ load_plugins (void)
The registry will look for plugins in the default
plugin path and directories specified using the
GRL_PLUGIN_PATH environment variable */
- if (!grl_registry_load_all (registry, &error)) {
+ if (!grl_registry_load_all_plugins (registry, &error)) {
g_error ("Failed to load plugins: %s", error->message);
}
}
diff --git a/examples/multivalues.c b/examples/multivalues.c
index cbee694..c31a54c 100644
--- a/examples/multivalues.c
+++ b/examples/multivalues.c
@@ -99,7 +99,7 @@ load_plugins (void)
registry = grl_registry_get_default ();
g_signal_connect (registry, "source-added",
G_CALLBACK (source_added_cb), NULL);
- if (!grl_registry_load_all (registry, &error)) {
+ if (!grl_registry_load_all_plugins (registry, &error)) {
g_error ("Failed to load plugins: %s", error->message);
}
}
diff --git a/examples/searching.c b/examples/searching.c
index 8ec13bf..0779660 100644
--- a/examples/searching.c
+++ b/examples/searching.c
@@ -92,7 +92,7 @@ load_plugins (void)
registry = grl_registry_get_default ();
g_signal_connect (registry, "source-added",
G_CALLBACK (source_added_cb), NULL);
- if (!grl_registry_load_all (registry, &error)) {
+ if (!grl_registry_load_all_plugins (registry, &error)) {
g_error ("Failed to load plugins: %s", error->message);
}
}
diff --git a/src/grl-registry.c b/src/grl-registry.c
index 9eb70a8..6712b4b 100644
--- a/src/grl-registry.c
+++ b/src/grl-registry.c
@@ -467,8 +467,8 @@ grl_registry_preload_plugins (GrlRegistry *registry,
}
static gboolean
-grl_registry_load_list (GrlRegistry *registry,
- GList *plugin_list)
+grl_registry_load_plugin_list (GrlRegistry *registry,
+ GList *plugin_list)
{
GrlPlugin *plugin;
gboolean loaded_one = FALSE;
@@ -478,9 +478,9 @@ grl_registry_load_list (GrlRegistry *registry,
if (grl_plugin_get_module (plugin)) {
loaded_one |= activate_plugin (registry, plugin, NULL);
} else {
- loaded_one |= grl_registry_load (registry,
- grl_plugin_get_filename (plugin),
- NULL);
+ loaded_one |= grl_registry_load_plugin (registry,
+ grl_plugin_get_filename (plugin),
+ NULL);
}
plugin_list = g_list_next (plugin_list);
}
@@ -589,7 +589,7 @@ key_id_handler_get_all_keys (struct KeyIDHandler *handler)
* Restrict the plugins that application sees to this list.
*
* Other plugins will not be available for the application, unless it uses
- * directly #grl_registry_load() function.
+ * directly #grl_registry_load_plugin() function.
**/
void
grl_registry_restrict_plugins (GrlRegistry *registry,
@@ -753,7 +753,7 @@ grl_registry_add_directory (GrlRegistry *registry,
}
/**
- * grl_registry_load:
+ * grl_registry_load_plugin:
* @registry: the registry instance
* @library_filename: the path to the so file
* @error: error return location or @NULL to ignore
@@ -765,9 +765,9 @@ grl_registry_add_directory (GrlRegistry *registry,
* Since: 0.1.7
*/
gboolean
-grl_registry_load (GrlRegistry *registry,
- const gchar *library_filename,
- GError **error)
+grl_registry_load_plugin (GrlRegistry *registry,
+ const gchar *library_filename,
+ GError **error)
{
GModule *module;
GrlPluginDescriptor *plugin_desc;
@@ -858,7 +858,7 @@ grl_registry_load (GrlRegistry *registry,
}
/**
- * grl_registry_load_directory:
+ * grl_registry_load_plugin_directory:
* @registry: the registry instance
* @path: the path to the directory
* @error: error return location or @NULL to ignore
@@ -871,9 +871,9 @@ grl_registry_load (GrlRegistry *registry,
* Since: 0.1.7
*/
gboolean
-grl_registry_load_directory (GrlRegistry *registry,
- const gchar *path,
- GError **error)
+grl_registry_load_plugin_directory (GrlRegistry *registry,
+ const gchar *path,
+ GError **error)
{
GList *preloaded_plugins = NULL;
@@ -883,7 +883,7 @@ grl_registry_load_directory (GrlRegistry *registry,
grl_registry_preload_plugins_directory (registry, path, &preloaded_plugins);
/* Load the plugins */
- if (!grl_registry_load_list (registry, preloaded_plugins)) {
+ if (!grl_registry_load_plugin_list (registry, preloaded_plugins)) {
GRL_WARNING ("No plugins loaded from directory '%s'", path);
}
g_list_free (preloaded_plugins);
@@ -892,7 +892,7 @@ grl_registry_load_directory (GrlRegistry *registry,
}
/**
- * grl_registry_load_all:
+ * grl_registry_load_all_plugins:
* @registry: the registry instance
* @error: error return location or @NULL to ignore
*
@@ -908,7 +908,7 @@ grl_registry_load_directory (GrlRegistry *registry,
* Since: 0.1.1
*/
gboolean
-grl_registry_load_all (GrlRegistry *registry, GError **error)
+grl_registry_load_all_plugins (GrlRegistry *registry, GError **error)
{
GList *all_plugins;
gboolean loaded_one;
@@ -923,7 +923,7 @@ grl_registry_load_all (GrlRegistry *registry, GError **error)
/* Now load all plugins */
all_plugins = g_hash_table_get_values (registry->priv->plugins);
- loaded_one = grl_registry_load_list (registry, all_plugins);
+ loaded_one = grl_registry_load_plugin_list (registry, all_plugins);
g_list_free (all_plugins);
@@ -939,7 +939,7 @@ grl_registry_load_all (GrlRegistry *registry, GError **error)
}
/**
- * grl_registry_load_by_id:
+ * grl_registry_load_plugin_by_id:
* @registry: the registry instance
* @plugin_id: plugin identifier
* @error: error return location or @NULL to ignore
@@ -955,9 +955,9 @@ grl_registry_load_all (GrlRegistry *registry, GError **error)
* Since: 0.1.14
**/
gboolean
-grl_registry_load_by_id (GrlRegistry *registry,
- const gchar *plugin_id,
- GError **error)
+grl_registry_load_plugin_by_id (GrlRegistry *registry,
+ const gchar *plugin_id,
+ GError **error)
{
GrlPlugin *plugin;
gboolean is_loaded;
@@ -995,7 +995,7 @@ grl_registry_load_by_id (GrlRegistry *registry,
}
/* Load plugin */
- return grl_registry_load (registry, grl_plugin_get_filename (plugin), error);
+ return grl_registry_load_plugin (registry, grl_plugin_get_filename (plugin), error);
}
/**
@@ -1163,7 +1163,7 @@ grl_registry_get_plugins (GrlRegistry *registry,
}
/**
- * grl_registry_unload:
+ * grl_registry_unload_plugin:
* @registry: the registry instance
* @plugin_id: the identifier of the plugin
* @error: error return location or @NULL to ignore
@@ -1176,15 +1176,15 @@ grl_registry_get_plugins (GrlRegistry *registry,
* Since: 0.1.7
*/
gboolean
-grl_registry_unload (GrlRegistry *registry,
- const gchar *plugin_id,
- GError **error)
+grl_registry_unload_plugin (GrlRegistry *registry,
+ const gchar *plugin_id,
+ GError **error)
{
GrlPlugin *plugin;
GList *sources = NULL;
GList *sources_iter;
- GRL_DEBUG ("grl_registry_unload: %s", plugin_id);
+ GRL_DEBUG ("%s: %s", __FUNCTION__, plugin_id);
g_return_val_if_fail (GRL_IS_REGISTRY (registry), FALSE);
g_return_val_if_fail (plugin_id != NULL, FALSE);
diff --git a/src/grl-registry.h b/src/grl-registry.h
index 6632846..48978f6 100644
--- a/src/grl-registry.h
+++ b/src/grl-registry.h
@@ -185,24 +185,24 @@ GrlRegistry *grl_registry_get_default (void);
void grl_registry_add_directory (GrlRegistry *registry,
const gchar *path);
-gboolean grl_registry_load (GrlRegistry *registry,
- const gchar *library_filename,
- GError **error);
+gboolean grl_registry_load_plugin (GrlRegistry *registry,
+ const gchar *library_filename,
+ GError **error);
-gboolean grl_registry_load_directory (GrlRegistry *registry,
- const gchar *path,
- GError **error);
+gboolean grl_registry_load_plugin_directory (GrlRegistry *registry,
+ const gchar *path,
+ GError **error);
-gboolean grl_registry_unload (GrlRegistry *registry,
- const gchar *plugin_id,
- GError **error);
+gboolean grl_registry_unload_plugin (GrlRegistry *registry,
+ const gchar *plugin_id,
+ GError **error);
-gboolean grl_registry_load_all (GrlRegistry *registry,
- GError **error);
+gboolean grl_registry_load_all_plugins (GrlRegistry *registry,
+ GError **error);
-gboolean grl_registry_load_by_id (GrlRegistry *registry,
- const gchar *plugin_id,
- GError **error);
+gboolean grl_registry_load_plugin_by_id (GrlRegistry *registry,
+ const gchar *plugin_id,
+ GError **error);
gboolean grl_registry_register_source (GrlRegistry *registry,
GrlPlugin *plugin,
diff --git a/tests/metadata_source.c b/tests/metadata_source.c
index 9a9ba0f..6dfb93a 100644
--- a/tests/metadata_source.c
+++ b/tests/metadata_source.c
@@ -66,7 +66,7 @@ load_metadata_sources ()
g_test_log_set_fatal_handler (registry_load_error_handler, NULL);
#endif
- if (!grl_registry_load_all (reg, NULL))
+ if (!grl_registry_load_all_plugins (reg, NULL))
return false;
keys = grl_registry_get_metadata_keys (reg);
diff --git a/tests/registry.c b/tests/registry.c
index 4826e1b..484a8c5 100644
--- a/tests/registry.c
+++ b/tests/registry.c
@@ -85,7 +85,7 @@ registry_load (RegistryFixture *fixture, gconstpointer data)
{
gboolean res;
- res = grl_registry_load_all (fixture->registry, NULL);
+ res = grl_registry_load_all_plugins (fixture->registry, NULL);
g_assert_cmpint (res, ==, TRUE);
}
diff --git a/tools/grilo-inspect/grl-inspect.c b/tools/grilo-inspect/grl-inspect.c
index 0f640e2..c9083c3 100644
--- a/tools/grilo-inspect/grl-inspect.c
+++ b/tools/grilo-inspect/grl-inspect.c
@@ -250,7 +250,7 @@ main (int argc, char *argv[])
mainloop = g_main_loop_new (NULL, FALSE);
- grl_registry_load_all (registry, NULL);
+ grl_registry_load_all_plugins (registry, NULL);
if (delay > 0) {
g_timeout_add_seconds ((guint) delay, run, NULL);
diff --git a/tools/grilo-test-ui/main.c b/tools/grilo-test-ui/main.c
index 6750992..cf3ed34 100644
--- a/tools/grilo-test-ui/main.c
+++ b/tools/grilo-test-ui/main.c
@@ -2138,7 +2138,7 @@ load_plugins (void)
G_CALLBACK (source_added_cb), NULL);
g_signal_connect (registry, "source-removed",
G_CALLBACK (source_removed_cb), NULL);
- if (!grl_registry_load_all (registry, NULL)) {
+ if (!grl_registry_load_all_plugins (registry, NULL)) {
g_error ("Failed to load plugins.");
}
}
@@ -2168,9 +2168,9 @@ shutdown_plugins (void)
for (plugin_iter = plugins;
plugin_iter;
plugin_iter = g_list_next (plugin_iter)) {
- grl_registry_unload (registry,
- grl_plugin_get_id (GRL_PLUGIN (plugin_iter->data)),
- NULL);
+ grl_registry_unload_plugin (registry,
+ grl_plugin_get_id (GRL_PLUGIN (plugin_iter->data)),
+ NULL);
}
g_list_free (plugins);
@@ -2191,7 +2191,7 @@ load_all_plugins ()
registry = grl_registry_get_default ();
- grl_registry_load_all (registry, NULL);
+ grl_registry_load_all_plugins (registry, NULL);
}
static void
diff --git a/tools/vala/grilo-test.vala b/tools/vala/grilo-test.vala
index 60b5c12..0920c5f 100644
--- a/tools/vala/grilo-test.vala
+++ b/tools/vala/grilo-test.vala
@@ -11,7 +11,7 @@ public class SimplePlaylist : Object {
registry.source_added.connect (source_added_cb);
registry.source_removed.connect (source_removed_cb);
- if (registry.load_all () == false) {
+ if (registry.load_all_plugins () == false) {
error ("Failed to load plugins.");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]