[gtk+] gtk_recent_chooser_set_filter: Allow NULL value to unset the filter.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtk_recent_chooser_set_filter: Allow NULL value to unset the filter.
- Date: Sat, 6 Apr 2013 09:07:09 +0000 (UTC)
commit fbb94477851224a4fc9d7a25bec0284727c5eee5
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Sat Apr 6 17:56:19 2013 +0900
gtk_recent_chooser_set_filter: Allow NULL value to unset the filter.
While GtkRecentChooser implementations accept for the "filter" property
to unset the current filter, the API fires an unneeded assertion.
This patch removes the assertion.
gtk/gtkrecentchooser.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkrecentchooser.c b/gtk/gtkrecentchooser.c
index bbaa4c6..4918fbc 100644
--- a/gtk/gtkrecentchooser.c
+++ b/gtk/gtkrecentchooser.c
@@ -962,7 +962,7 @@ gtk_recent_chooser_list_filters (GtkRecentChooser *chooser)
/**
* gtk_recent_chooser_set_filter:
* @chooser: a #GtkRecentChooser
- * @filter: a #GtkRecentFilter
+ * @filter: (allow-none): a #GtkRecentFilter
*
* Sets @filter as the current #GtkRecentFilter object used by @chooser
* to affect the displayed recently used resources.
@@ -974,7 +974,7 @@ gtk_recent_chooser_set_filter (GtkRecentChooser *chooser,
GtkRecentFilter *filter)
{
g_return_if_fail (GTK_IS_RECENT_CHOOSER (chooser));
- g_return_if_fail (GTK_IS_RECENT_FILTER (filter));
+ g_return_if_fail (filter == NULL || GTK_IS_RECENT_FILTER (filter));
g_object_set (G_OBJECT (chooser), "filter", filter, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]