┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/selectionmanager.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-01-28 19:29:17 +0000
committerPeter Penz <[email protected]>2008-01-28 19:29:17 +0000
commitfaf1f0f2d6fcb070a0a0927e3dbb6a9512c9e5c6 (patch)
tree6f0b4bba87fbba20f42cf802960e4327e212efcc /src/selectionmanager.cpp
parent91656a8abc3aadc78630341079d3c2ca9f2533c0 (diff)
take care to remove the selection toggle when items have been deleted
svn path=/trunk/KDE/kdebase/apps/; revision=767778
Diffstat (limited to 'src/selectionmanager.cpp')
-rw-r--r--src/selectionmanager.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/selectionmanager.cpp b/src/selectionmanager.cpp
index 31ad70b74..bdb4c5368 100644
--- a/src/selectionmanager.cpp
+++ b/src/selectionmanager.cpp
@@ -65,6 +65,9 @@ void SelectionManager::slotEntered(const QModelIndex& index)
if (index.isValid() && (index.column() == DolphinModel::Name)) {
m_item = itemForIndex(index);
+ connect(m_view->model(), SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
+ this, SLOT(slotRowsRemoved(const QModelIndex&, int, int)));
+
const QRect rect = m_view->visualRect(index);
const int gap = 2;
const int x = rect.right() - m_button->width() - gap;
@@ -83,13 +86,14 @@ void SelectionManager::slotEntered(const QModelIndex& index)
m_button->show();
} else {
m_item = KFileItem();
+ disconnect(m_view->model(), SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
+ this, SLOT(slotRowsRemoved(const QModelIndex&, int, int)));
}
}
void SelectionManager::slotViewportEntered()
{
m_button->hide();
- m_item = KFileItem();
}
void SelectionManager::setItemSelected(bool selected)
@@ -108,6 +112,14 @@ void SelectionManager::setItemSelected(bool selected)
}
}
+void SelectionManager::slotRowsRemoved(const QModelIndex& parent, int start, int end)
+{
+ Q_UNUSED(parent);
+ Q_UNUSED(start);
+ Q_UNUSED(end);
+ m_button->hide();
+}
+
KFileItem SelectionManager::itemForIndex(const QModelIndex& index) const
{
QAbstractProxyModel* proxyModel = static_cast<QAbstractProxyModel*>(m_view->model());