X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-selector.c;h=7f34baebafcbcbad1ff98535aa30f1fdcb293a4e;hb=4ea6e37d180c9412cbcd39afa48a516522e6dd71;hp=f3f684a16fc1e1e004835926c77ce45c5403e780;hpb=1d5a97ba2afec23855a8294ff2814ab052f6777a;p=pspp-builds.git
diff --git a/src/ui/gui/psppire-selector.c b/src/ui/gui/psppire-selector.c
index f3f684a1..7f34baeb 100644
--- a/src/ui/gui/psppire-selector.c
+++ b/src/ui/gui/psppire-selector.c
@@ -1,10 +1,9 @@
-/*
- PSPPIRE --- A Graphical User Interface for PSPP
+/* PSPPIRE - a graphical user interface for PSPP.
Copyright (C) 2007 Free Software Foundation
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -13,9 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see . */
/*
This module provides a widget, PsppireSelector derived from
@@ -68,6 +65,7 @@
#include
#include
+#include
#include
static void psppire_selector_base_finalize (PsppireSelectorClass *, gpointer);
@@ -561,8 +559,8 @@ is_source_item_visible (GtkTreeModel *childmodel,
{
PsppireSelector *selector = list->data;
- if ( selector->filter (childmodel, iter, selector))
- return FALSE;
+ if ( selector->filter && selector->filter (childmodel, iter, selector))
+ return FALSE;
list = list->next;
}
@@ -717,6 +715,8 @@ psppire_selector_set_subjects (PsppireSelector *selector,
SelectItemsFunc *select_func,
FilterItemsFunc *filter_func )
{
+ g_assert(selector);
+
selector->filter = filter_func ;
selector->source = source;
@@ -743,6 +743,11 @@ psppire_selector_set_subjects (PsppireSelector *selector,
else if ( GTK_IS_ENTRY (dest))
set_entry_dest (selector, GTK_ENTRY (dest));
+ else if (GTK_IS_TEXT_VIEW (dest))
+ {
+ /* Nothing to be done */
+ }
+
else
g_error ("Unsupported destination widget: %s", G_OBJECT_TYPE_NAME (dest));