27 #include "kiconviewsearchline.h"
29 #include <tqiconview.h>
34 #define DEFAULT_CASESENSITIVE false
36 typedef TQValueList <TQIconViewItem *> QIconViewItemList;
38 class TDEIconViewSearchLine::TDEIconViewSearchLinePrivate
41 TDEIconViewSearchLinePrivate() :
44 activeSearch( false ),
45 queuedSearches( 0 ) {}
81 return d->caseSensitive;
97 d->search = s.isNull() ? text() : s;
98 TQIconViewItem *currentItem = d->iconView->currentItem();
99 TQIconViewItem *item = NULL;
102 TQIconViewItem *i = d->iconView->firstItem();
103 while ( i != NULL ) {
109 if ( item == currentItem )
119 if ( currentItem != NULL )
120 d->iconView->ensureItemVisible( currentItem );
129 TQIconViewItem *item = NULL;
131 TQIconViewItem *i = d->iconView->firstItem();
132 while ( i != NULL ) {
139 d->queuedSearches = 0;
149 d->caseSensitive = cs;
154 if ( d->iconView != NULL )
155 disconnect( d->iconView, TQT_SIGNAL( destroyed() ),
156 this, TQT_SLOT( iconViewDeleted() ) );
162 connect( d->iconView, TQT_SIGNAL( destroyed() ),
163 this, TQT_SLOT( iconViewDeleted() ) );
174 const TQString &s )
const
182 TQString itemtext = item->text();
189 d =
new TDEIconViewSearchLinePrivate;
193 connect(
this, TQT_SIGNAL( textChanged(
const TQString & ) ),
194 this, TQT_SLOT(
queueSearch(
const TQString & ) ) );
196 if ( iconView != NULL )
198 connect( iconView, TQT_SIGNAL( destroyed() ),
199 this, TQT_SLOT( iconViewDeleted() ) );
208 if ( ( item == NULL ) || ( d->iconView == NULL ) )
211 item->setVisible(
false);
216 if ( d->iconView == NULL )
218 kdDebug() << __FILE__ <<
":" << __LINE__ <<
219 "showItem() could not be called while there's no iconView set." <<
224 item->setVisible(
true);
241 if ( d->queuedSearches <= 0 )
244 d->queuedSearches = 0;
254 void TDEIconViewSearchLine::iconViewDeleted()
260 #include "kiconviewsearchline.moc"