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;
95 int original_hiddenListChanged;
100 TQString search = d->search = s.isNull() ? text() : s;
101 TQIconViewItem *currentItem = d->iconView->currentItem();
103 TQIconViewItem *item = NULL;
106 TQIconViewItem *i = d->iconView->firstItem();
107 while ( i != NULL ) {
113 if ( item == currentItem )
122 d->iconView->arrangeItemsInGrid(
true);
124 if ( currentItem != NULL )
125 d->iconView->ensureItemVisible( currentItem );
131 TQIconViewItem *item = NULL;
133 TQIconViewItem *i = d->iconView->firstItem();
134 while ( i != NULL ) {
141 d->queuedSearches = 0;
151 d->caseSensitive = cs;
156 if ( d->iconView != NULL )
157 disconnect( d->iconView, TQT_SIGNAL( destroyed() ),
158 this, TQT_SLOT( iconViewDeleted() ) );
164 connect( d->iconView, TQT_SIGNAL( destroyed() ),
165 this, TQT_SLOT( iconViewDeleted() ) );
176 const TQString &s )
const
184 TQString itemtext = item->text();
191 d =
new TDEIconViewSearchLinePrivate;
195 connect(
this, TQT_SIGNAL( textChanged(
const TQString & ) ),
196 this, TQT_SLOT(
queueSearch(
const TQString & ) ) );
198 if ( iconView != NULL )
200 connect( iconView, TQT_SIGNAL( destroyed() ),
201 this, TQT_SLOT( iconViewDeleted() ) );
210 if ( ( item == NULL ) || ( d->iconView == NULL ) )
213 item->setVisible(
false);
218 if ( d->iconView == NULL )
220 kdDebug() << __FILE__ <<
":" << __LINE__ <<
221 "showItem() could not be called while there's no iconView set." <<
226 item->setVisible(
true);
243 if ( d->queuedSearches <= 0 )
246 d->queuedSearches = 0;
256 void TDEIconViewSearchLine::iconViewDeleted()
262 #include "kiconviewsearchline.moc"