[totem] grilo: Don't warn when setting invalid search source
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] grilo: Don't warn when setting invalid search source
- Date: Wed, 29 Jan 2014 18:20:43 +0000 (UTC)
commit 87c7ab48e5bb63e1a9173ccc27f63a0159ff38ee
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jan 29 14:47:12 2014 +0100
grilo: Don't warn when setting invalid search source
Instead, return a boolean to show failure. This allows us
to try to set the search easily without having to find
whether it supports search.
src/plugins/grilo/totem-search-entry.c | 8 +++++---
src/plugins/grilo/totem-search-entry.h | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/grilo/totem-search-entry.c b/src/plugins/grilo/totem-search-entry.c
index 1146b83..6ea50fe 100644
--- a/src/plugins/grilo/totem-search-entry.c
+++ b/src/plugins/grilo/totem-search-entry.c
@@ -364,11 +364,12 @@ totem_search_entry_get_selected_id (TotemSearchEntry *self)
return id;
}
-void
+gboolean
totem_search_entry_set_selected_id (TotemSearchEntry *self,
const char *id)
{
GList *children, *l;
+ gboolean ret = FALSE;
g_return_if_fail (TOTEM_IS_SEARCH_ENTRY (self));
g_return_if_fail (id != NULL);
@@ -382,15 +383,16 @@ totem_search_entry_set_selected_id (TotemSearchEntry *self,
listbox_row_activated (GTK_LIST_BOX (self->priv->listbox),
GTK_LIST_BOX_ROW (l->data),
self);
+ ret = TRUE;
goto end;
}
}
- g_warning ("Could not find ID '%s' in TotemSearchEntry %p",
- id, self);
+ g_debug ("Could not find ID '%s' in TotemSearchEntry %p", id, self);
end:
g_list_free (children);
+ return ret;
}
GtkEntry *
diff --git a/src/plugins/grilo/totem-search-entry.h b/src/plugins/grilo/totem-search-entry.h
index c549202..420c395 100644
--- a/src/plugins/grilo/totem-search-entry.h
+++ b/src/plugins/grilo/totem-search-entry.h
@@ -63,7 +63,7 @@ void totem_search_entry_remove_source (TotemSearchEntry *self,
const gchar *id);
const char *totem_search_entry_get_selected_id (TotemSearchEntry *self);
-void totem_search_entry_set_selected_id (TotemSearchEntry *self,
+gboolean totem_search_entry_set_selected_id (TotemSearchEntry *self,
const char *id);
const char *totem_search_entry_get_text (TotemSearchEntry *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]