]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphindetailsview.cpp
allow dropping items above a place inside the Places panel
[dolphin.git] / src / dolphindetailsview.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz *
3 * peter.penz@gmx.at *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
20
21 #include "dolphindetailsview.h"
22
23 #include "dolphinmodel.h"
24 #include "dolphincontroller.h"
25 #include "dolphinsettings.h"
26 #include "dolphinsortfilterproxymodel.h"
27 #include "draganddrophelper.h"
28 #include "selectionmanager.h"
29 #include "viewproperties.h"
30
31 #include "dolphin_detailsmodesettings.h"
32 #include "dolphin_generalsettings.h"
33
34 #include <kdirmodel.h>
35 #include <klocale.h>
36 #include <kmenu.h>
37
38 #include <QAbstractProxyModel>
39 #include <QAction>
40 #include <QApplication>
41 #include <QHeaderView>
42 #include <QRubberBand>
43 #include <QPainter>
44 #include <QScrollBar>
45
46 DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* controller) :
47 QTreeView(parent),
48 m_autoResize(true),
49 m_controller(controller),
50 m_font(),
51 m_decorationSize(),
52 m_dragging(false),
53 m_showElasticBand(false),
54 m_elasticBandOrigin(),
55 m_elasticBandDestination()
56 {
57 Q_ASSERT(controller != 0);
58
59 setAcceptDrops(true);
60 setRootIsDecorated(false);
61 setSortingEnabled(true);
62 setUniformRowHeights(true);
63 setSelectionBehavior(SelectItems);
64 setDragDropMode(QAbstractItemView::DragDrop);
65 setDropIndicatorShown(false);
66 setAlternatingRowColors(true);
67 setItemsExpandable(false);
68
69 setMouseTracking(true);
70 viewport()->setAttribute(Qt::WA_Hover);
71
72 const ViewProperties props(controller->url());
73 setSortIndicatorSection(props.sorting());
74 setSortIndicatorOrder(props.sortOrder());
75
76 QHeaderView* headerView = header();
77 connect(headerView, SIGNAL(sectionClicked(int)),
78 this, SLOT(synchronizeSortingState(int)));
79 headerView->setContextMenuPolicy(Qt::CustomContextMenu);
80 connect(headerView, SIGNAL(customContextMenuRequested(const QPoint&)),
81 this, SLOT(configureColumns(const QPoint&)));
82 connect(headerView, SIGNAL(sectionResized(int, int, int)),
83 this, SLOT(slotHeaderSectionResized(int, int, int)));
84 connect(headerView, SIGNAL(sectionHandleDoubleClicked(int)),
85 this, SLOT(disableAutoResizing()));
86
87 connect(parent, SIGNAL(sortingChanged(DolphinView::Sorting)),
88 this, SLOT(setSortIndicatorSection(DolphinView::Sorting)));
89 connect(parent, SIGNAL(sortOrderChanged(Qt::SortOrder)),
90 this, SLOT(setSortIndicatorOrder(Qt::SortOrder)));
91
92 // TODO: Connecting to the signal 'activated()' is not possible, as kstyle
93 // does not forward the single vs. doubleclick to it yet (KDE 4.1?). Hence it is
94 // necessary connecting the signal 'singleClick()' or 'doubleClick' and to handle the
95 // RETURN-key in keyPressEvent().
96 if (KGlobalSettings::singleClick()) {
97 connect(this, SIGNAL(clicked(const QModelIndex&)),
98 this, SLOT(triggerItem(const QModelIndex&)));
99 if (DolphinSettings::instance().generalSettings()->showSelectionToggle()) {
100 SelectionManager* selManager = new SelectionManager(this);
101 connect(selManager, SIGNAL(selectionChanged()),
102 this, SLOT(requestActivation()));
103 connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
104 selManager, SLOT(reset()));
105 }
106 } else {
107 connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
108 this, SLOT(triggerItem(const QModelIndex&)));
109 }
110 connect(this, SIGNAL(entered(const QModelIndex&)),
111 this, SLOT(slotEntered(const QModelIndex&)));
112 connect(this, SIGNAL(viewportEntered()),
113 controller, SLOT(emitViewportEntered()));
114 connect(controller, SIGNAL(zoomIn()),
115 this, SLOT(zoomIn()));
116 connect(controller, SIGNAL(zoomOut()),
117 this, SLOT(zoomOut()));
118 connect(controller->dolphinView(), SIGNAL(additionalInfoChanged()),
119 this, SLOT(updateColumnVisibility()));
120
121 // apply the details mode settings to the widget
122 const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
123 Q_ASSERT(settings != 0);
124
125 m_font = QFont(settings->fontFamily(), settings->fontSize());
126
127 // TODO: Remove this check when 4.3.2 is released and KDE requires it... this
128 // check avoids a division by zero happening on versions before 4.3.1.
129 // Right now KDE in theory can be shipped with Qt 4.3.0 and above.
130 // ereslibre
131 #if (QT_VERSION >= QT_VERSION_CHECK(4, 3, 2) || defined(QT_KDE_QT_COPY))
132 setVerticalScrollMode(QTreeView::ScrollPerPixel);
133 setHorizontalScrollMode(QTreeView::ScrollPerPixel);
134 #endif
135
136 updateDecorationSize();
137
138 setFocus();
139 }
140
141 DolphinDetailsView::~DolphinDetailsView()
142 {
143 }
144
145 bool DolphinDetailsView::event(QEvent* event)
146 {
147 if (event->type() == QEvent::Polish) {
148 QHeaderView* headerView = header();
149 headerView->setResizeMode(QHeaderView::Interactive);
150 headerView->setMovable(false);
151
152 updateColumnVisibility();
153
154 hideColumn(DolphinModel::Rating);
155 hideColumn(DolphinModel::Tags);
156 }
157 // TODO: Remove this check when 4.3.2 is released and KDE requires it... this
158 // check avoids a division by zero happening on versions before 4.3.1.
159 // Right now KDE in theory can be shipped with Qt 4.3.0 and above.
160 // ereslibre
161 #if (QT_VERSION >= QT_VERSION_CHECK(4, 3, 2) || defined(QT_KDE_QT_COPY))
162 else if (event->type() == QEvent::UpdateRequest) {
163 // a wheel movement will scroll 4 items
164 if (model()->rowCount() > 0) {
165 verticalScrollBar()->setSingleStep((sizeHintForRow(0) / 3) * 4);
166 }
167 }
168 #endif
169
170 return QTreeView::event(event);
171 }
172
173 QStyleOptionViewItem DolphinDetailsView::viewOptions() const
174 {
175 QStyleOptionViewItem viewOptions = QTreeView::viewOptions();
176 viewOptions.font = m_font;
177 viewOptions.showDecorationSelected = true;
178 viewOptions.decorationSize = m_decorationSize;
179 return viewOptions;
180 }
181
182 void DolphinDetailsView::contextMenuEvent(QContextMenuEvent* event)
183 {
184 QTreeView::contextMenuEvent(event);
185 m_controller->triggerContextMenuRequest(event->pos());
186 }
187
188 void DolphinDetailsView::mousePressEvent(QMouseEvent* event)
189 {
190 m_controller->requestActivation();
191
192 QTreeView::mousePressEvent(event);
193
194 const QModelIndex index = indexAt(event->pos());
195 if (!index.isValid() || (index.column() != DolphinModel::Name)) {
196 const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
197 if (!(modifier & Qt::ShiftModifier) && !(modifier & Qt::ControlModifier)) {
198 clearSelection();
199 }
200 }
201
202 if (event->button() == Qt::LeftButton) {
203 m_showElasticBand = true;
204
205 const QPoint pos(contentsPos());
206 m_elasticBandOrigin = event->pos();
207 m_elasticBandOrigin.setX(m_elasticBandOrigin.x() + pos.x());
208 m_elasticBandOrigin.setY(m_elasticBandOrigin.y() + pos.y());
209 m_elasticBandDestination = event->pos();
210 }
211 }
212
213 void DolphinDetailsView::mouseMoveEvent(QMouseEvent* event)
214 {
215 if (m_showElasticBand) {
216 const QPoint mousePos = event->pos();
217 const QModelIndex index = indexAt(mousePos);
218 if (!index.isValid()) {
219 // the destination of the selection rectangle is above the viewport. In this
220 // case QTreeView does no selection at all, which is not the wanted behavior
221 // in Dolphin -> select all items within the elastic band rectangle
222 clearSelection();
223
224 const int nameColumnWidth = header()->sectionSize(DolphinModel::Name);
225 QRect selRect = QRect(m_elasticBandOrigin, m_elasticBandDestination).normalized();
226 const QRect nameColumnsRect(0, 0, nameColumnWidth, viewport()->height());
227 selRect = nameColumnsRect.intersected(selRect);
228
229 setSelection(selRect, QItemSelectionModel::Select);
230 }
231
232 QTreeView::mouseMoveEvent(event);
233 updateElasticBand();
234 } else {
235 QTreeView::mouseMoveEvent(event);
236 }
237 }
238
239 void DolphinDetailsView::mouseReleaseEvent(QMouseEvent* event)
240 {
241 QTreeView::mouseReleaseEvent(event);
242 if (m_showElasticBand) {
243 updateElasticBand();
244 m_showElasticBand = false;
245 }
246 }
247
248 void DolphinDetailsView::startDrag(Qt::DropActions supportedActions)
249 {
250 DragAndDropHelper::startDrag(this, supportedActions);
251 }
252
253 void DolphinDetailsView::dragEnterEvent(QDragEnterEvent* event)
254 {
255 if (event->mimeData()->hasUrls()) {
256 event->acceptProposedAction();
257 }
258
259 if (m_showElasticBand) {
260 updateElasticBand();
261 m_showElasticBand = false;
262 }
263 m_dragging = true;
264 }
265
266 void DolphinDetailsView::dragLeaveEvent(QDragLeaveEvent* event)
267 {
268 QTreeView::dragLeaveEvent(event);
269
270 // TODO: remove this code when the issue #160611 is solved in Qt 4.4
271 m_dragging = false;
272 setDirtyRegion(m_dropRect);
273 }
274
275 void DolphinDetailsView::dragMoveEvent(QDragMoveEvent* event)
276 {
277 QTreeView::dragMoveEvent(event);
278
279 // TODO: remove this code when the issue #160611 is solved in Qt 4.4
280 setDirtyRegion(m_dropRect);
281 const QModelIndex index = indexAt(event->pos());
282 if (!index.isValid() || (index.column() != DolphinModel::Name)) {
283 m_dragging = false;
284 } else {
285 m_dragging = true;
286 const KFileItem item = itemForIndex(index);
287 if (!item.isNull() && item.isDir()) {
288 m_dropRect = visualRect(index);
289 } else {
290 m_dropRect.setSize(QSize()); // set as invalid
291 }
292 setDirtyRegion(m_dropRect);
293 }
294
295 if (event->mimeData()->hasUrls()) {
296 // accept url drops, independently from the destination item
297 event->acceptProposedAction();
298 }
299 }
300
301 void DolphinDetailsView::dropEvent(QDropEvent* event)
302 {
303 const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
304 if (!urls.isEmpty()) {
305 event->acceptProposedAction();
306 const QModelIndex index = indexAt(event->pos());
307 KFileItem item;
308 if (index.isValid() && (index.column() == DolphinModel::Name)) {
309 item = itemForIndex(index);
310 }
311 m_controller->indicateDroppedUrls(urls,
312 m_controller->url(),
313 item);
314 }
315 QTreeView::dropEvent(event);
316 m_dragging = false;
317 }
318
319 void DolphinDetailsView::paintEvent(QPaintEvent* event)
320 {
321 QTreeView::paintEvent(event);
322 if (m_showElasticBand) {
323 // The following code has been taken from QListView
324 // and adapted to DolphinDetailsView.
325 // (C) 1992-2007 Trolltech ASA
326 QStyleOptionRubberBand opt;
327 opt.initFrom(this);
328 opt.shape = QRubberBand::Rectangle;
329 opt.opaque = false;
330 opt.rect = elasticBandRect();
331
332 QPainter painter(viewport());
333 painter.save();
334 style()->drawControl(QStyle::CE_RubberBand, &opt, &painter);
335 painter.restore();
336 }
337
338 // TODO: remove this code when the issue #160611 is solved in Qt 4.4
339 if (m_dragging) {
340 const QBrush& brush = viewOptions().palette.brush(QPalette::Normal, QPalette::Highlight);
341 DragAndDropHelper::drawHoverIndication(this, m_dropRect, brush);
342 }
343 }
344
345 void DolphinDetailsView::keyPressEvent(QKeyEvent* event)
346 {
347 QTreeView::keyPressEvent(event);
348
349 const QItemSelectionModel* selModel = selectionModel();
350 const QModelIndex currentIndex = selModel->currentIndex();
351 const bool trigger = currentIndex.isValid()
352 && (event->key() == Qt::Key_Return)
353 && (selModel->selectedIndexes().count() <= 1);
354 if (trigger) {
355 triggerItem(currentIndex);
356 }
357 }
358
359 void DolphinDetailsView::resizeEvent(QResizeEvent* event)
360 {
361 QTreeView::resizeEvent(event);
362 if (m_autoResize) {
363 resizeColumns();
364 }
365 }
366
367 void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting)
368 {
369 QHeaderView* headerView = header();
370 headerView->setSortIndicator(sorting, headerView->sortIndicatorOrder());
371 }
372
373 void DolphinDetailsView::setSortIndicatorOrder(Qt::SortOrder sortOrder)
374 {
375 QHeaderView* headerView = header();
376 headerView->setSortIndicator(headerView->sortIndicatorSection(), sortOrder);
377 }
378
379 void DolphinDetailsView::synchronizeSortingState(int column)
380 {
381 // The sorting has already been changed in QTreeView if this slot is
382 // invoked, but Dolphin is not informed about this.
383 DolphinView::Sorting sorting = DolphinSortFilterProxyModel::sortingForColumn(column);
384 const Qt::SortOrder sortOrder = header()->sortIndicatorOrder();
385 m_controller->indicateSortingChange(sorting);
386 m_controller->indicateSortOrderChange(sortOrder);
387 }
388
389 void DolphinDetailsView::slotEntered(const QModelIndex& index)
390 {
391 const QPoint pos = viewport()->mapFromGlobal(QCursor::pos());
392 const int nameColumnWidth = header()->sectionSize(DolphinModel::Name);
393 if (pos.x() < nameColumnWidth) {
394 m_controller->emitItemEntered(itemForIndex(index));
395 }
396 else {
397 m_controller->emitViewportEntered();
398 }
399 }
400
401 void DolphinDetailsView::updateElasticBand()
402 {
403 if (m_showElasticBand) {
404 QRect dirtyRegion(elasticBandRect());
405 m_elasticBandDestination = viewport()->mapFromGlobal(QCursor::pos());
406 dirtyRegion = dirtyRegion.united(elasticBandRect());
407 setDirtyRegion(dirtyRegion);
408 }
409 }
410
411 QRect DolphinDetailsView::elasticBandRect() const
412 {
413 const QPoint pos(contentsPos());
414 const QPoint topLeft(m_elasticBandOrigin.x() - pos.x(), m_elasticBandOrigin.y() - pos.y());
415 return QRect(topLeft, m_elasticBandDestination).normalized();
416 }
417
418 void DolphinDetailsView::zoomIn()
419 {
420 if (isZoomInPossible()) {
421 DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
422 switch (settings->iconSize()) {
423 case KIconLoader::SizeSmall: settings->setIconSize(KIconLoader::SizeMedium); break;
424 case KIconLoader::SizeMedium: settings->setIconSize(KIconLoader::SizeLarge); break;
425 default: Q_ASSERT(false); break;
426 }
427 updateDecorationSize();
428 }
429 }
430
431 void DolphinDetailsView::zoomOut()
432 {
433 if (isZoomOutPossible()) {
434 DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
435 switch (settings->iconSize()) {
436 case KIconLoader::SizeLarge: settings->setIconSize(KIconLoader::SizeMedium); break;
437 case KIconLoader::SizeMedium: settings->setIconSize(KIconLoader::SizeSmall); break;
438 default: Q_ASSERT(false); break;
439 }
440 updateDecorationSize();
441 }
442 }
443
444 void DolphinDetailsView::triggerItem(const QModelIndex& index)
445 {
446 const KFileItem item = itemForIndex(index);
447 if (index.isValid() && (index.column() == KDirModel::Name)) {
448 m_controller->triggerItem(item);
449 } else {
450 clearSelection();
451 m_controller->emitItemEntered(item);
452 }
453 }
454
455 void DolphinDetailsView::configureColumns(const QPoint& pos)
456 {
457 KMenu popup(this);
458 popup.addTitle(i18nc("@title:menu", "Columns"));
459
460 QHeaderView* headerView = header();
461 for (int i = DolphinModel::Size; i <= DolphinModel::Type; ++i) {
462 const int logicalIndex = headerView->logicalIndex(i);
463 const QString text = model()->headerData(i, Qt::Horizontal).toString();
464 QAction* action = popup.addAction(text);
465 action->setCheckable(true);
466 action->setChecked(!headerView->isSectionHidden(logicalIndex));
467 action->setData(i);
468 }
469
470 QAction* activatedAction = popup.exec(header()->mapToGlobal(pos));
471 if (activatedAction != 0) {
472 const bool show = activatedAction->isChecked();
473 const int columnIndex = activatedAction->data().toInt();
474
475 KFileItemDelegate::InformationList list = m_controller->dolphinView()->additionalInfo();
476 const KFileItemDelegate::Information info = infoForColumn(columnIndex);
477 if (show) {
478 Q_ASSERT(!list.contains(info));
479 list.append(info);
480 } else {
481 Q_ASSERT(list.contains(info));
482 const int index = list.indexOf(info);
483 list.removeAt(index);
484 }
485
486 m_controller->indicateAdditionalInfoChange(list);
487 setColumnHidden(columnIndex, !show);
488 }
489 }
490
491 void DolphinDetailsView::updateColumnVisibility()
492 {
493 const KFileItemDelegate::InformationList list = m_controller->dolphinView()->additionalInfo();
494 for (int i = DolphinModel::Size; i <= DolphinModel::Type; ++i) {
495 const KFileItemDelegate::Information info = infoForColumn(i);
496 const bool hide = !list.contains(info);
497 if (isColumnHidden(i) != hide) {
498 setColumnHidden(i, hide);
499 }
500 }
501
502 resizeColumns();
503 }
504
505 void DolphinDetailsView::slotHeaderSectionResized(int logicalIndex, int oldSize, int newSize)
506 {
507 Q_UNUSED(logicalIndex);
508 Q_UNUSED(oldSize);
509 Q_UNUSED(newSize);
510 if (QApplication::mouseButtons() & Qt::LeftButton) {
511 disableAutoResizing();
512 }
513 }
514
515 void DolphinDetailsView::disableAutoResizing()
516 {
517 m_autoResize = false;
518 }
519
520 void DolphinDetailsView::requestActivation()
521 {
522 m_controller->requestActivation();
523 }
524
525 bool DolphinDetailsView::isZoomInPossible() const
526 {
527 DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
528 return settings->iconSize() < KIconLoader::SizeLarge;
529 }
530
531 bool DolphinDetailsView::isZoomOutPossible() const
532 {
533 DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
534 return settings->iconSize() > KIconLoader::SizeSmall;
535 }
536
537 void DolphinDetailsView::updateDecorationSize()
538 {
539 DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
540 const int iconSize = settings->iconSize();
541 setIconSize(QSize(iconSize, iconSize));
542 m_decorationSize = QSize(iconSize, iconSize);
543
544 m_controller->setZoomInPossible(isZoomInPossible());
545 m_controller->setZoomOutPossible(isZoomOutPossible());
546
547 doItemsLayout();
548 }
549
550 QPoint DolphinDetailsView::contentsPos() const
551 {
552 // implementation note: the horizonal position is ignored currently, as no
553 // horizontal scrolling is done anyway during a selection
554 const QScrollBar* scrollbar = verticalScrollBar();
555 Q_ASSERT(scrollbar != 0);
556
557 const int maxHeight = maximumViewportSize().height();
558 const int height = scrollbar->maximum() - scrollbar->minimum() + 1;
559 const int visibleHeight = model()->rowCount() + 1 - height;
560 if (visibleHeight <= 0) {
561 return QPoint(0, 0);
562 }
563
564 const int y = scrollbar->sliderPosition() * maxHeight / visibleHeight;
565 return QPoint(0, y);
566 }
567
568 KFileItem DolphinDetailsView::itemForIndex(const QModelIndex& index) const
569 {
570 QAbstractProxyModel* proxyModel = static_cast<QAbstractProxyModel*>(model());
571 KDirModel* dirModel = static_cast<KDirModel*>(proxyModel->sourceModel());
572 const QModelIndex dirIndex = proxyModel->mapToSource(index);
573 return dirModel->itemForIndex(dirIndex);
574 }
575
576 KFileItemDelegate::Information DolphinDetailsView::infoForColumn(int columnIndex) const
577 {
578 KFileItemDelegate::Information info = KFileItemDelegate::NoInformation;
579
580 switch (columnIndex) {
581 case DolphinModel::Size: info = KFileItemDelegate::Size; break;
582 case DolphinModel::ModifiedTime: info = KFileItemDelegate::ModificationTime; break;
583 case DolphinModel::Permissions: info = KFileItemDelegate::Permissions; break;
584 case DolphinModel::Owner: info = KFileItemDelegate::Owner; break;
585 case DolphinModel::Group: info = KFileItemDelegate::OwnerAndGroup; break;
586 case DolphinModel::Type: info = KFileItemDelegate::FriendlyMimeType; break;
587 default: break;
588 }
589
590 return info;
591 }
592
593 void DolphinDetailsView::resizeColumns()
594 {
595 // Using the resize mode QHeaderView::ResizeToContents is too slow (it takes
596 // around 3 seconds for each (!) resize operation when having > 10000 items).
597 // This gets a problem especially when opening large directories, where several
598 // resize operations are received for showing the currently available items during
599 // loading (the application hangs around 20 seconds when loading > 10000 items).
600
601 QHeaderView* headerView = header();
602 QFontMetrics fontMetrics(viewport()->font());
603
604 int columnWidth[KDirModel::ColumnCount];
605 columnWidth[KDirModel::Size] = fontMetrics.width("00000 Items");
606 columnWidth[KDirModel::ModifiedTime] = fontMetrics.width("0000-00-00 00:00");
607 columnWidth[KDirModel::Permissions] = fontMetrics.width("xxxxxxxxxx");
608 columnWidth[KDirModel::Owner] = fontMetrics.width("xxxxxxxxxx");
609 columnWidth[KDirModel::Group] = fontMetrics.width("xxxxxxxxxx");
610 columnWidth[KDirModel::Type] = fontMetrics.width("XXXX Xxxxxxx");
611
612 int requiredWidth = 0;
613 for (int i = KDirModel::Size; i <= KDirModel::Type; ++i) {
614 if (!isColumnHidden(i)) {
615 columnWidth[i] += 20; // provide a default gap
616 requiredWidth += columnWidth[i];
617 headerView->resizeSection(i, columnWidth[i]);
618 }
619 }
620
621 // resize the name column in a way that the whole available width is used
622 columnWidth[KDirModel::Name] = viewport()->width() - requiredWidth;
623 if (columnWidth[KDirModel::Name] < 120) {
624 columnWidth[KDirModel::Name] = 120;
625 }
626 headerView->resizeSection(KDirModel::Name, columnWidth[KDirModel::Name]);
627 }
628
629 #include "dolphindetailsview.moc"