[grilo] test-ui: Ask for all fast keys when browsing



commit 3b9d0fe783a8b554f54e3c28f694c559f61a307f
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Mon May 21 19:05:41 2012 +0000

    test-ui: Ask for all fast keys when browsing
    
    Asking for all the fast keys in a browse/search operation is the most efficient
    way if you want to show all they keys. It will take just one query to the
    service to solve all those keys in a row.
    
    For slow keys, let's use metadata() to resolve them when user clicks the item.

 tools/grilo-test-ui/main.c |   33 +++++++++------------------------
 1 files changed, 9 insertions(+), 24 deletions(-)
---
diff --git a/tools/grilo-test-ui/main.c b/tools/grilo-test-ui/main.c
index 48ad5af..093b261 100644
--- a/tools/grilo-test-ui/main.c
+++ b/tools/grilo-test-ui/main.c
@@ -356,22 +356,7 @@ get_icon_for_media (GrlMedia *media)
 }
 
 static GList *
-browse_keys (void)
-{
-  static GList *keys = NULL;
-
-  if (!keys) {
-    keys = grl_metadata_key_list_new (GRL_METADATA_KEY_ID,
-                                      GRL_METADATA_KEY_TITLE,
-                                      GRL_METADATA_KEY_CHILDCOUNT,
-                                      GRL_METADATA_KEY_INVALID);
-  }
-
-  return keys;
-}
-
-static GList *
-metadata_keys (void)
+all_keys (void)
 {
   GrlPluginRegistry *registry;
   static GList *keys = NULL;
@@ -714,7 +699,7 @@ browse_search_query_cb (GrlMediaSource *source,
 	    next_op_id =
 	      grl_media_source_browse (source,
 				       ui_state->cur_container,
-				       browse_keys (),
+				       all_keys (),
 				       options,
 				       browse_search_query_cb,
 				       state);
@@ -723,7 +708,7 @@ browse_search_query_cb (GrlMediaSource *source,
 	    next_op_id =
 	      grl_media_source_search (source,
 				       state->text,
-				       browse_keys (),
+				       all_keys (),
 				       options,
 				       browse_search_query_cb,
 				       state);
@@ -732,7 +717,7 @@ browse_search_query_cb (GrlMediaSource *source,
 	    next_op_id =
 	      grl_media_source_query (source,
 				      state->text,
-				      browse_keys (),
+				      all_keys (),
 				      options,
 				      browse_search_query_cb,
 				      state);
@@ -778,7 +763,7 @@ browse (GrlMediaSource *source, GrlMedia *container)
     state->type = OP_TYPE_BROWSE;
     browse_id = grl_media_source_browse (source,
                                          container,
-                                         browse_keys (),
+                                         all_keys (),
                                          default_options,
                                          browse_search_query_cb,
                                          state);
@@ -845,7 +830,7 @@ metadata (GrlMediaSource *source, GrlMedia *media)
          GRL_OP_METADATA)) {
           grl_media_source_metadata (source,
                                      media,
-                                     metadata_keys (),
+                                     all_keys (),
                                      default_metadata_options,
                                      metadata_cb,
                                      NULL);
@@ -1151,7 +1136,7 @@ search (GrlMediaSource *source, const gchar *text)
     state->type = OP_TYPE_SEARCH;
     search_id = grl_media_source_search (source,
 					 text,
-					 browse_keys (),
+					 all_keys (),
 					 default_options,
 					 browse_search_query_cb,
 					 state);
@@ -1161,7 +1146,7 @@ search (GrlMediaSource *source, const gchar *text)
     state->type = OP_TYPE_MULTI_SEARCH;
     search_id = grl_multiple_search (NULL,
 				     text,
-				     browse_keys (),
+				     all_keys (),
 				     default_options,
 				     browse_search_query_cb,
 				     state);
@@ -1210,7 +1195,7 @@ query (GrlMediaSource *source, const gchar *text)
   state->type = OP_TYPE_QUERY;
   query_id = grl_media_source_query (source,
                                      text,
-                                     browse_keys (),
+                                     all_keys (),
                                      default_options,
                                      browse_search_query_cb,
                                      state);



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