diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-31 14:05:59 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-08-26 16:05:33 +0200 |
commit | 29768dd7b2ee05ba0f6c1f1f2c0270cc0e237438 (patch) | |
tree | 114b4d0736f423d76bcab7c393fc95bdb11f5ef8 /kdeui/klistview.cpp | |
parent | c89b32ebab33674df362f2262263504d210dde83 (diff) | |
download | tdelibs-29768dd7b2ee05ba0f6c1f1f2c0270cc0e237438.tar.gz tdelibs-29768dd7b2ee05ba0f6c1f1f2c0270cc0e237438.zip |
Fix konq filter in list view mode
Select all now only selects shown (filtered) items
(cherry picked from commit 06b514847fffb79985e4bcde9f8dcc685c5d9ac5)
Diffstat (limited to 'kdeui/klistview.cpp')
-rw-r--r-- | kdeui/klistview.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/kdeui/klistview.cpp b/kdeui/klistview.cpp index e1c5811ca..b52fe6876 100644 --- a/kdeui/klistview.cpp +++ b/kdeui/klistview.cpp @@ -2356,6 +2356,52 @@ void KListViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, TQListViewItem::paintCell(p, _cg, column, width, alignment); } +/*! + If \a select is TRUE, all the items get selected; otherwise all + the items get unselected. This only works in the selection modes \c + Multi and \c Extended. In \c Single and \c NoSelection mode the + selection of the current item is just set to \a select. +*/ + +void KListView::selectAll( bool select ) +{ + if ( selectionMode() == Multi || selectionMode() == Extended ) { + bool b = signalsBlocked(); + blockSignals( TRUE ); + bool anything = FALSE; + TQListViewItemIterator it( this ); + while ( it.current() ) { + TQListViewItem *i = it.current(); + if ( select == TRUE ) { + if ( (bool)i->isVisible() == TRUE ) { + i->setSelected( TRUE ); + anything = TRUE; + } + if ( (bool)i->isVisible() == FALSE ) { + i->setSelected( FALSE ); + anything = TRUE; + } + } + else { + if ( (bool)i->isSelected() != select ) { + i->setSelected( select ); + anything = TRUE; + } + } + ++it; + } + blockSignals( b ); + if ( anything ) { + emit selectionChanged(); +// d->useDoubleBuffer = TRUE; + triggerUpdate(); + } + } else if ( currentItem() ) { + TQListViewItem * i = currentItem(); + setSelected( i, select ); + } +} + void KListView::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } |