diff options
| author | Simon Paul St James <[email protected]> | 2008-10-26 15:48:29 +0000 |
|---|---|---|
| committer | Simon Paul St James <[email protected]> | 2008-10-26 15:48:29 +0000 |
| commit | c1e71770751426cc22dfe281f190795acdc907ec (patch) | |
| tree | bbe9d58b2f4092a9a707a269d3bc62e491cf1077 | |
| parent | 5735251bbb28e6d96f3e43abd9302efc28d6829e (diff) | |
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
| -rw-r--r-- | src/dolphindetailsview.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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); |
