]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use nameColumnRect rather than duplicating code (change the local variable of the...
authorSimon Paul St James <kdedevel@etotheipiplusone.com>
Tue, 28 Oct 2008 19:40:51 +0000 (19:40 +0000)
committerSimon Paul St James <kdedevel@etotheipiplusone.com>
Tue, 28 Oct 2008 19:40:51 +0000 (19:40 +0000)
Use KFileItem::text() instead of KFileItem::name() there, too.

svn path=/trunk/KDE/kdebase/apps/; revision=877159

src/dolphindetailsview.cpp

index efdead0c7722ce27aa955229d03ddd4c5aa21620..f51d3b0347b6f03c0d0b0732ecea508f5181d860 100644 (file)
@@ -652,8 +652,8 @@ void DolphinDetailsView::updateElasticBandSelection()
     const int nameColumnX = header()->sectionPosition(DolphinModel::Name);
     const int nameColumnWidth = header()->sectionSize(DolphinModel::Name);
     QRect selRect = elasticBandRect().normalized();
-    QRect nameColumnRect(nameColumnX, selRect.y(), nameColumnWidth, selRect.height());
-    selRect = nameColumnRect.intersect(selRect).normalized();
+    QRect nameColumnArea(nameColumnX, selRect.y(), nameColumnWidth, selRect.height());
+    selRect = nameColumnArea.intersect(selRect).normalized();
 
     if (selRect.isNull()) {
         selectionModel()->select(m_band.originalSelection, QItemSelectionModel::ClearAndSelect);
@@ -741,9 +741,7 @@ void DolphinDetailsView::updateElasticBandSelection()
    QModelIndex toggleIndexRangeBegin = QModelIndex();
 
    do {
-       QRect currIndexRect = visualRect(currIndex);
-       const QString name = m_controller->itemForIndex(currIndex).name();       
-       currIndexRect.setWidth(DolphinFileItemDelegate::nameColumnWidth(name, viewOptions()));
+       QRect currIndexRect = nameColumnRect(currIndex);
 
         // Update some optimisation info as we go.
        const int cr = currIndexRect.right();
@@ -902,7 +900,7 @@ QRect DolphinDetailsView::nameColumnRect(const QModelIndex& index) const
     QRect rect = visualRect(index);
     const KFileItem item = m_controller->itemForIndex(index);
     if (!item.isNull()) {
-        const int width = DolphinFileItemDelegate::nameColumnWidth(item.name(), viewOptions());
+        const int width = DolphinFileItemDelegate::nameColumnWidth(item.text(), viewOptions());
         rect.setWidth(width);
     }