┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphindetailsview.cpp
diff options
context:
space:
mode:
authorSimon Paul St James <[email protected]>2008-10-28 19:40:51 +0000
committerSimon Paul St James <[email protected]>2008-10-28 19:40:51 +0000
commit1984e18ad1935a4eb12fc36b892ca6a90ad88503 (patch)
tree3f503b9c7cc407856b357c59c4ffc96b58eb2619 /src/dolphindetailsview.cpp
parenta124b15cfec8da4c16b9c8588bb69a00772a0566 (diff)
Use nameColumnRect rather than duplicating code (change the local variable of the same name to prevent clashes!)
Use KFileItem::text() instead of KFileItem::name() there, too. svn path=/trunk/KDE/kdebase/apps/; revision=877159
Diffstat (limited to 'src/dolphindetailsview.cpp')
-rw-r--r--src/dolphindetailsview.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index efdead0c7..f51d3b034 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -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);
}