Re: [PATCH 1/7] vimeo: Handle search all elements
- From: Iago Toral <itoral igalia com>
- To: <grilo-list gnome org>
- Subject: Re: [PATCH 1/7] vimeo: Handle search all elements
- Date: Thu, 03 Feb 2011 07:19:13 +0000
On Wed, 2 Feb 2011 21:26:35 +0100, "Juan A. Suarez Romero"
<jasuarez igalia com> wrote:
Vimeo does not support searching all elements.
Thus, an error is sent in this case.
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
---
src/vimeo/grl-vimeo.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/vimeo/grl-vimeo.c b/src/vimeo/grl-vimeo.c
index af8f665..8273e99 100644
--- a/src/vimeo/grl-vimeo.c
+++ b/src/vimeo/grl-vimeo.c
@@ -385,9 +385,20 @@ grl_vimeo_source_search (GrlMediaSource *source,
GrlMediaSourceSearchSpec *ss)
{
SearchData *sd;
+ GError *error;
gint per_page;
GVimeo *vimeo = GRL_VIMEO_SOURCE (source)->priv->vimeo;
+ if (!ss->text) {
+ /* Vimeo does not support searching all */
+ error = g_error_new_literal (GRL_CORE_ERROR,
+ GRL_CORE_ERROR_SEARCH_FAILED,
+ "Unable to search all elements");
I would go more for an error message like this:
"Unable to execute NULL-text search"
"Unable to execute search: non NULL search text is required"
The same for other plugins with the same issue.
+ ss->callback (ss->source, ss->search_id, NULL, 0, ss->user_data,
error);
+ g_error_free (error);
+ return;
+ }
+
/* Compute items per page and page offset */
per_page = CLAMP (1 + ss->skip + ss->count, 0, 100);
g_vimeo_set_per_page (vimeo, per_page);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]