From ab464bc6849dd000b2d0258ececb78ef1eb1a685 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 26 Jan 2008 22:32:24 +0000 Subject: reset the selection manager when the URL has been changed (otherwise the selection toggle button would stay visible) svn path=/trunk/KDE/kdebase/apps/; revision=766918 --- src/selectionmanager.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/selectionmanager.cpp') diff --git a/src/selectionmanager.cpp b/src/selectionmanager.cpp index 1f9d99b85..31ad70b74 100644 --- a/src/selectionmanager.cpp +++ b/src/selectionmanager.cpp @@ -47,14 +47,18 @@ SelectionManager::SelectionManager(QAbstractItemView* parent) : m_button->hide(); connect(m_button, SIGNAL(clicked(bool)), this, SLOT(setItemSelected(bool))); - connect(m_view->selectionModel(), SIGNAL(selectionChanged()), - this, SLOT(slotSelectionChanged())); } SelectionManager::~SelectionManager() { } +void SelectionManager::reset() +{ + m_button->hide(); + m_item = KFileItem(); +} + void SelectionManager::slotEntered(const QModelIndex& index) { m_button->hide(); @@ -88,15 +92,6 @@ void SelectionManager::slotViewportEntered() m_item = KFileItem(); } -void SelectionManager::slotSelectionChanged() -{ - const QModelIndex index = indexForItem(m_item); - if (index.isValid()) { - QItemSelectionModel* selModel = m_view->selectionModel(); - m_button->setChecked(selModel->isSelected(index)); - } -} - void SelectionManager::setItemSelected(bool selected) { emit selectionChanged(); -- cgit v1.3