From 924d9936719a780488cdafecd77346c84a620c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 7 Jul 2017 02:41:34 +0200 Subject: Konqueror: Deselect items that are hidden by the filter during Select and Deselect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- konqueror/iconview/konq_iconview.cc | 26 ++++++++++++++++++-------- konqueror/listview/konq_listview.cc | 28 ++++++++++++++++++++-------- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/konqueror/iconview/konq_iconview.cc b/konqueror/iconview/konq_iconview.cc index 595c02948..5efc1e751 100644 --- a/konqueror/iconview/konq_iconview.cc +++ b/konqueror/iconview/konq_iconview.cc @@ -557,10 +557,15 @@ void KonqKfmIconView::slotSelect() m_pIconView->blockSignals( true ); TQIconViewItem *it = m_pIconView->firstItem(); - while ( it ) - { - if ( re.exactMatch( it->text() ) ) - it->setSelected( true, true ); + while ( it ) { + if ( it->isVisible() ) { + if ( re.exactMatch( it->text() ) ) { + it->setSelected( true, true ); + } + } + else { + it->setSelected( false, true ); + } it = it->nextItem(); } @@ -584,10 +589,15 @@ void KonqKfmIconView::slotUnselect() m_pIconView->blockSignals( true ); TQIconViewItem *it = m_pIconView->firstItem(); - while ( it ) - { - if ( re.exactMatch( it->text() ) ) - it->setSelected( false, true ); + while ( it ) { + if ( it->isVisible() ) { + if ( re.exactMatch( it->text() ) ) { + it->setSelected( false, true ); + } + } + else { + it->setSelected( false, true ); + } it = it->nextItem(); } diff --git a/konqueror/listview/konq_listview.cc b/konqueror/listview/konq_listview.cc index 8c9369a4c..67da49c6d 100644 --- a/konqueror/listview/konq_listview.cc +++ b/konqueror/listview/konq_listview.cc @@ -389,17 +389,22 @@ void KonqListView::slotSelect() for (KonqBaseListViewWidget::iterator it = m_pListView->begin(); it != m_pListView->end(); it++ ) { - if ((m_pListView->automaticSelection()) && (it->isSelected())) - { + if ((m_pListView->automaticSelection()) && (it->isSelected())) { it->setSelected(FALSE); //the following line is to prevent that more than one item were selected //and now get deselected and automaticSelection() was true, this shouldn't happen //but who knows, aleXXX m_pListView->deactivateAutomaticSelection(); - }; - if ( re.exactMatch( it->text(0) ) ) - it->setSelected( TRUE); - }; + } + if ( it->isVisible() ) { + if ( re.exactMatch( it->text(0) ) ) { + it->setSelected(TRUE); + } + } + else { + it->setSelected(FALSE); + } + } m_pListView->blockSignals( false ); m_pListView->deactivateAutomaticSelection(); emit m_pListView->selectionChanged(); @@ -418,9 +423,16 @@ void KonqListView::slotUnselect() m_pListView->blockSignals(TRUE); - for (KonqBaseListViewWidget::iterator it = m_pListView->begin(); it != m_pListView->end(); it++ ) - if ( re.exactMatch( it->text(0) ) ) + for (KonqBaseListViewWidget::iterator it = m_pListView->begin(); it != m_pListView->end(); it++ ) { + if ( it->isVisible() ) { + if ( re.exactMatch( it->text(0) ) ) { + it->setSelected(FALSE); + } + } + else { it->setSelected(FALSE); + } + } m_pListView->blockSignals(FALSE); m_pListView->deactivateAutomaticSelection(); -- cgit v1.2.1