Re: [PATCH 1/2] core: Allow NULL text search()
- From: Iago Toral <itoral igalia com>
- To: <grilo-list gnome org>
- Subject: Re: [PATCH 1/2] core: Allow NULL text search()
- Date: Thu, 03 Feb 2011 07:15:28 +0000
On Wed, 2 Feb 2011 21:22:58 +0100, "Juan A. Suarez Romero"
<jasuarez igalia com> wrote:
Searching for a NULL text returns all non-boxes elements in the
source.
Basically, it is equal as "search all elements" with no restriction.
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
---
src/grl-media-source.c | 9 ++++++++-
src/grl-multiple.c | 3 ++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/grl-media-source.c b/src/grl-media-source.c
index e5312d8..0c65b9a 100644
--- a/src/grl-media-source.c
+++ b/src/grl-media-source.c
@@ -1439,6 +1439,10 @@ grl_media_source_browse_sync (GrlMediaSource
*source,
* Search for the @text string in a media source for data identified
with
* that string.
*
+ * If @text is @NULL then search will return all elements from
@source. If
+ * @source does not support this option then it will send an error
in the
+ * callback.
+ *
I prefer this wording instead:
If @text is NULL then no text filter will be applied, and thus, no
media items from @source will be filtered. If @source does not support
NULL-text search operations it should notify the client by setting the
error parameter in @callback.
* This method is asynchronous.
*
* Returns: the operation identifier
@@ -1466,7 +1470,6 @@ grl_media_source_search (GrlMediaSource
*source,
gboolean full_chained = FALSE;
g_return_val_if_fail (GRL_IS_MEDIA_SOURCE (source), 0);
- g_return_val_if_fail (text != NULL, 0);
g_return_val_if_fail (callback != NULL, 0);
g_return_val_if_fail (count > 0, 0);
g_return_val_if_fail (grl_metadata_source_supported_operations
(GRL_METADATA_SOURCE (source)) &
@@ -1567,6 +1570,10 @@ grl_media_source_search (GrlMediaSource
*source,
* Search for the @text string in a media source for data identified
with
* that string.
*
+ * If @text is @NULL then search will return all elements from
@source. If
+ * @source does not support this option then it will send an error
in the
+ * callback.
+ *
Same wording as above.
* This method is synchronous.
*
* Returns: (element-type Grl.Media) (transfer full): a #GList with
#GrlMedia
diff --git a/src/grl-multiple.c b/src/grl-multiple.c
index a9db969..dfae8a9 100644
--- a/src/grl-multiple.c
+++ b/src/grl-multiple.c
@@ -486,6 +486,8 @@ media_from_uri_cb (GrlMediaSource *source,
*
* Search for @text in all the sources specified in @sources.
*
+ * If @text is @NULL then search will return all elements from
@sources.
+ *
I would use this wording instead:
If @text is NULL then NULL-text searchs will be used for each
searchable plugin (see #grl_media_source_search for more details).
* This method is asynchronous.
*
* Returns: the operation identifier
@@ -509,7 +511,6 @@ grl_multiple_search (const GList *sources,
GRL_DEBUG ("grl_multiple_search");
g_return_val_if_fail (count > 0, 0);
- g_return_val_if_fail (text != NULL, 0);
g_return_val_if_fail (callback != NULL, 0);
if (!pending_operations) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]