[grilo-plugins] tracker: updated for the new caps and options APIs
- From: Guillaume JÃrÃme Emont <guijemont src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] tracker: updated for the new caps and options APIs
- Date: Wed, 14 Dec 2011 13:58:25 +0000 (UTC)
commit 9183415f85731b531cb4ab5ede884683ead64690
Author: Guillaume Emont <guijemont igalia com>
Date: Tue Sep 6 16:46:21 2011 +0200
tracker: updated for the new caps and options APIs
src/media/tracker/grl-tracker-media-api.c | 38 +++++++++++++++++-----------
src/media/tracker/grl-tracker-metadata.c | 1 +
src/media/tracker/grl-tracker-utils.c | 12 +++++++++
src/media/tracker/grl-tracker-utils.h | 3 ++
4 files changed, 39 insertions(+), 15 deletions(-)
---
diff --git a/src/media/tracker/grl-tracker-media-api.c b/src/media/tracker/grl-tracker-media-api.c
index 8ac0d57..71526b2 100644
--- a/src/media/tracker/grl-tracker-media-api.c
+++ b/src/media/tracker/grl-tracker-media-api.c
@@ -552,6 +552,8 @@ grl_tracker_media_query (GrlMediaSource *source,
gchar *sparql_final;
gchar *sparql_select;
GrlTrackerOp *os;
+ gint count = grl_operation_options_get_count (qs->options);
+ guint skip = grl_operation_options_get_skip (qs->options);
GRL_IDEBUG ("%s: id=%u", __FUNCTION__, qs->query_id);
@@ -570,8 +572,8 @@ grl_tracker_media_query (GrlMediaSource *source,
sparql_select,
qs->query,
constraint,
- qs->skip,
- qs->count);
+ skip,
+ count);
g_free (constraint);
g_free (qs->query);
g_free (sparql_select);
@@ -588,8 +590,8 @@ grl_tracker_media_query (GrlMediaSource *source,
qs);
os->keys = qs->keys;
- os->skip = qs->skip;
- os->count = qs->count;
+ os->skip = skip;
+ os->count = count;
os->data = qs;
/* os->cb.sr = qs->callback; */
/* os->user_data = qs->user_data; */
@@ -688,6 +690,8 @@ grl_tracker_media_search (GrlMediaSource *source, GrlMediaSourceSearchSpec *ss)
gchar *sparql_select;
gchar *sparql_final;
GrlTrackerOp *os;
+ gint count = grl_operation_options_get_count (ss->options);
+ guint skip = grl_operation_options_get_skip (ss->options);
GRL_IDEBUG ("%s: id=%u", __FUNCTION__, ss->search_id);
@@ -696,10 +700,10 @@ grl_tracker_media_search (GrlMediaSource *source, GrlMediaSourceSearchSpec *ss)
if (!ss->text || ss->text[0] == '\0') {
/* Search all */
sparql_final = g_strdup_printf (TRACKER_SEARCH_ALL_REQUEST, sparql_select,
- constraint, ss->skip, ss->count);
+ constraint, skip, count);
} else {
sparql_final = g_strdup_printf (TRACKER_SEARCH_REQUEST, sparql_select,
- ss->text, constraint, ss->skip, ss->count);
+ ss->text, constraint, skip, count);
}
GRL_IDEBUG ("\tselect: '%s'", sparql_final);
@@ -709,8 +713,8 @@ grl_tracker_media_search (GrlMediaSource *source, GrlMediaSourceSearchSpec *ss)
(GAsyncReadyCallback) tracker_search_cb,
ss);
os->keys = ss->keys;
- os->skip = ss->skip;
- os->count = ss->count;
+ os->skip = skip;
+ os->count = count;
grl_tracker_queue_push (grl_tracker_queue, os);
@@ -729,6 +733,8 @@ grl_tracker_media_browse_category (GrlMediaSource *source,
GrlTrackerOp *os;
GrlMedia *media;
const gchar *category;
+ gint count = grl_operation_options_get_count (bs->options);
+ guint skip = grl_operation_options_get_skip (bs->options);
GRL_IDEBUG ("%s: id=%u", __FUNCTION__, bs->browse_id);
@@ -777,7 +783,7 @@ grl_tracker_media_browse_category (GrlMediaSource *source,
sparql_select,
category,
constraint,
- bs->skip, bs->count);
+ skip, count);
GRL_IDEBUG ("\tselect: '%s'", sparql_final);
@@ -786,8 +792,8 @@ grl_tracker_media_browse_category (GrlMediaSource *source,
(GAsyncReadyCallback) tracker_browse_cb,
bs);
os->keys = bs->keys;
- os->skip = bs->skip;
- os->count = bs->count;
+ os->skip = skip;
+ os->count = count;
grl_tracker_queue_push (grl_tracker_queue, os);
@@ -804,6 +810,8 @@ grl_tracker_media_browse_filesystem (GrlMediaSource *source,
gchar *sparql_select;
gchar *sparql_final;
GrlTrackerOp *os;
+ gint count = grl_operation_options_get_count (bs->options);
+ guint skip = grl_operation_options_get_skip (bs->options);
GRL_IDEBUG ("%s: id=%u", __FUNCTION__, bs->browse_id);
@@ -816,7 +824,7 @@ grl_tracker_media_browse_filesystem (GrlMediaSource *source,
sparql_select,
grl_tracker_show_documents? TRACKER_BROWSE_SHOW_DOCUMENTS: "",
constraint,
- bs->skip, bs->count);
+ skip, count);
} else {
sparql_final = g_strdup_printf (TRACKER_BROWSE_FILESYSTEM_REQUEST,
@@ -824,7 +832,7 @@ grl_tracker_media_browse_filesystem (GrlMediaSource *source,
grl_tracker_show_documents? TRACKER_BROWSE_SHOW_DOCUMENTS: "",
constraint,
grl_media_get_id (bs->container),
- bs->skip, bs->count);
+ skip, count);
}
GRL_IDEBUG ("\tselect: '%s'", sparql_final);
@@ -834,8 +842,8 @@ grl_tracker_media_browse_filesystem (GrlMediaSource *source,
(GAsyncReadyCallback) tracker_browse_cb,
bs);
os->keys = bs->keys;
- os->skip = bs->skip;
- os->count = bs->count;
+ os->skip = skip;
+ os->count = count;
grl_tracker_queue_push (grl_tracker_queue, os);
diff --git a/src/media/tracker/grl-tracker-metadata.c b/src/media/tracker/grl-tracker-metadata.c
index 549d3af..ac1780f 100644
--- a/src/media/tracker/grl-tracker-metadata.c
+++ b/src/media/tracker/grl-tracker-metadata.c
@@ -121,6 +121,7 @@ grl_tracker_metadata_class_init (GrlTrackerMetadataClass * klass)
metadata_class->supported_keys = grl_tracker_supported_keys;
metadata_class->may_resolve = grl_tracker_metadata_may_resolve;
metadata_class->resolve = grl_tracker_metadata_resolve;
+ metadata_class->get_caps = grl_tracker_get_caps;
g_class->finalize = grl_tracker_metadata_finalize;
g_class->set_property = grl_tracker_metadata_set_property;
diff --git a/src/media/tracker/grl-tracker-utils.c b/src/media/tracker/grl-tracker-utils.c
index 2973242..f3debb0 100644
--- a/src/media/tracker/grl-tracker-utils.c
+++ b/src/media/tracker/grl-tracker-utils.c
@@ -662,3 +662,15 @@ grl_tracker_supported_keys (GrlMetadataSource *source)
return supported_keys;
}
+
+GrlCaps *
+grl_tracker_get_caps (GrlMetadataSource *source,
+ GrlSupportedOps operation)
+{
+ static GrlCaps *caps = NULL;
+
+ if (caps == NULL)
+ caps = grl_caps_new ();
+
+ return caps;
+}
diff --git a/src/media/tracker/grl-tracker-utils.h b/src/media/tracker/grl-tracker-utils.h
index b55ff8c..e9eb663 100644
--- a/src/media/tracker/grl-tracker-utils.h
+++ b/src/media/tracker/grl-tracker-utils.h
@@ -63,6 +63,9 @@ extern GrlKeyID grl_metadata_key_tracker_urn;
const GList *grl_tracker_supported_keys (GrlMetadataSource *source);
+GrlCaps * grl_tracker_get_caps (GrlMetadataSource *source,
+ GrlSupportedOps operation);
+
gboolean grl_tracker_key_is_supported (const GrlKeyID key);
void grl_tracker_setup_key_mappings (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]