[grilo/debian: 19/23] core: Fix grl_data_get_keys()



commit 31f86d054066d5ad117e42ee8158eb231d0f31c4
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri Mar 4 15:39:35 2011 +0000

    core: Fix grl_data_get_keys()
    
    Include also related keys in the returned list.
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 src/data/grl-data.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/src/data/grl-data.c b/src/data/grl-data.c
index c6ae51b..dfa301b 100644
--- a/src/data/grl-data.c
+++ b/src/data/grl-data.c
@@ -558,13 +558,27 @@ grl_data_has_key (GrlData *data, GrlKeyID key)
 GList *
 grl_data_get_keys (GrlData *data)
 {
-  GList *keylist;
+  GList *allkeys = NULL;
+  GList *keylist, *key;
+  GList *relkeys;
+  GrlPluginRegistry *registry;
 
   g_return_val_if_fail (GRL_IS_DATA (data), NULL);
 
   keylist = g_hash_table_get_keys (data->priv->data);
+  registry = grl_plugin_registry_get_default ();
+
+  /* Include also all related keys */
+  for (key = keylist; key; key = g_list_next (key)) {
+    relkeys =
+      g_list_copy ((GList *) grl_plugin_registry_lookup_metadata_key_relation (registry,
+                                                                               key->data));
+    allkeys = g_list_concat (allkeys, relkeys);
+  }
+
+  g_list_free (keylist);
 
-  return keylist;
+  return allkeys;
 }
 
 /**



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