Don't repaint a larger area than what's necessary when toggling the selection

from the action overlay.

svn path=/trunk/KDE/kdebase/apps/; revision=1082374
This commit is contained in:
Fredrik Höglund 2010-01-30 11:33:34 +00:00
parent 6390610b96
commit 73406eee64

View file

@ -147,9 +147,13 @@ void ActionOverlay::selected()
QItemSelectionModel *m_selectionModel = view->selectionModel();
if (m_hoverIndex.isValid()) {
const QModelIndex oldCurrent = m_selectionModel->currentIndex();
m_selectionModel->select(m_hoverIndex, QItemSelectionModel::Toggle);
m_selectionModel->setCurrentIndex(m_hoverIndex, QItemSelectionModel::NoUpdate);
view->markAreaDirty(view->visibleArea());
view->markAreaDirty(view->visualRect(m_hoverIndex));
if (oldCurrent.isValid() && oldCurrent != m_hoverIndex) {
view->markAreaDirty(view->visualRect(oldCurrent));
}
}
}