From: Simon Paul St James Date: Sun, 26 Oct 2008 15:48:29 +0000 (+0000) Subject: Revert http://websvn.kde.org/?view=rev&revision=876107 - it introduced a massive... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/c1e71770751426cc22dfe281f190795acdc907ec Revert http://websvn.kde.org/?view=rev&revision=876107 - it introduced a massive performance regression and also didn't really fix the issue. Use new way that fixes the issue in a less direct but more general way. Also - ;-- :) svn path=/trunk/KDE/kdebase/apps/; revision=876137 --- diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index c9d6af6a9..6563cb658 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -646,6 +646,7 @@ void DolphinDetailsView::updateElasticBandSelection() if (selRect.isNull()) { clearSelection(); + m_band.ignoreOldInfo = true; return; } @@ -677,7 +678,7 @@ void DolphinDetailsView::updateElasticBandSelection() ((selRect.right() < oldSelRect.right()) && (selRect.left() >= m_band.insideNearestRightEdge)) || ((selRect.right() > oldSelRect.right()) && - (selRect.right() >= m_band.outsideNearestRightEdge)); + (selRect.right() >= m_band.outsideNearestRightEdge)); if (!itemSelectionChanged) { return; @@ -686,7 +687,7 @@ void DolphinDetailsView::updateElasticBandSelection() } // Do the selection from scratch. Force a update of the horizontal distances info. - m_band.insideNearestLeftEdge = nameColumnX + nameColumnWidth + 1;; + m_band.insideNearestLeftEdge = nameColumnX + nameColumnWidth + 1; m_band.insideNearestRightEdge = nameColumnX - 1; m_band.outsideNearestLeftEdge = nameColumnX - 1; m_band.outsideNearestRightEdge = nameColumnX + nameColumnWidth + 1; @@ -724,7 +725,7 @@ void DolphinDetailsView::updateElasticBandSelection() QModelIndex toggleIndexRangeBegin = QModelIndex(); do { - QRect currIndexRect = visualRect(currIndex).intersect(nameColumnRect); + QRect currIndexRect = visualRect(currIndex); const QString name = m_controller->itemForIndex(currIndex).name(); currIndexRect.setWidth(DolphinFileItemDelegate::nameColumnWidth(name, viewOptions())); @@ -733,7 +734,7 @@ void DolphinDetailsView::updateElasticBandSelection() const int cl = currIndexRect.left(); const int sl = selRect.left(); const int sr = selRect.right(); - // "The right edge of the name is outside of the rect but nearer than m_outsideNearestLeft", etc + // "The right edge of the name is outside of the rect but nearer than m_outsideNearestLeft", etc if ((cr < sl && cr > m_band.outsideNearestLeftEdge)) { m_band.outsideNearestLeftEdge = cr; } @@ -746,7 +747,7 @@ void DolphinDetailsView::updateElasticBandSelection() if ((cr >= sl && cr <= sr && cr < m_band.insideNearestLeftEdge)) { m_band.insideNearestLeftEdge = cr; } - + bool currentlySelected = selectionModel()->isSelected(currIndex); bool intersectsSelectedRect = currIndexRect.intersects(selRect); bool needToToggleItem = (currentlySelected && !intersectsSelectedRect) || (!currentlySelected && intersectsSelectedRect);