1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3 * Copyright (C) 2006 by Gregor Kališnik <gregor@podnapisi.net> *
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. *
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. *
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 ***************************************************************************/
21 #include "dolphinview.h"
25 #include <QApplication>
27 #include <QItemSelectionModel>
28 #include <QMouseEvent>
29 #include <QVBoxLayout>
31 #include <kdirmodel.h>
32 #include <kfileitemdelegate.h>
34 #include <kio/netaccess.h>
35 #include <kio/renamedialog.h>
36 #include <kmimetyperesolver.h>
37 #include <konq_operations.h>
40 #include "dolphincontroller.h"
41 #include "dolphinstatusbar.h"
42 #include "dolphinmainwindow.h"
43 #include "dolphindirlister.h"
44 #include "dolphinsortfilterproxymodel.h"
45 #include "dolphindetailsview.h"
46 #include "dolphiniconsview.h"
47 #include "dolphincontextmenu.h"
48 #include "filterbar.h"
49 #include "renamedialog.h"
50 #include "urlnavigator.h"
51 #include "viewproperties.h"
53 DolphinView::DolphinView(DolphinMainWindow
* mainWindow
,
57 bool showHiddenFiles
) :
59 m_showProgress(false),
64 m_mainWindow(mainWindow
),
77 setFocusPolicy(Qt::StrongFocus
);
78 m_topLayout
= new QVBoxLayout(this);
79 m_topLayout
->setSpacing(0);
80 m_topLayout
->setMargin(0);
82 m_urlNavigator
= new UrlNavigator(url
, this);
83 connect(m_urlNavigator
, SIGNAL(urlChanged(const KUrl
&)),
84 this, SLOT(loadDirectory(const KUrl
&)));
86 m_statusBar
= new DolphinStatusBar(this);
88 m_dirLister
= new DolphinDirLister();
89 m_dirLister
->setAutoUpdate(true);
90 m_dirLister
->setMainWindow(this);
91 m_dirLister
->setShowingDotFiles(showHiddenFiles
);
92 m_dirLister
->setDelayedMimeTypes(true);
94 connect(m_dirLister
, SIGNAL(clear()),
95 this, SLOT(updateStatusBar()));
96 connect(m_dirLister
, SIGNAL(percent(int)),
97 this, SLOT(updateProgress(int)));
98 connect(m_dirLister
, SIGNAL(deleteItem(KFileItem
*)),
99 this, SLOT(updateStatusBar()));
100 connect(m_dirLister
, SIGNAL(completed()),
101 this, SLOT(updateItemCount()));
102 connect(m_dirLister
, SIGNAL(infoMessage(const QString
&)),
103 this, SLOT(showInfoMessage(const QString
&)));
104 connect(m_dirLister
, SIGNAL(errorMessage(const QString
&)),
105 this, SLOT(showErrorMessage(const QString
&)));
107 m_dirModel
= new KDirModel();
108 m_dirModel
->setDirLister(m_dirLister
);
109 m_dirModel
->setDropsAllowed(KDirModel::DropOnDirectory
);
111 m_proxyModel
= new DolphinSortFilterProxyModel(this);
112 m_proxyModel
->setSourceModel(m_dirModel
);
114 m_controller
= new DolphinController(this);
115 connect(m_controller
, SIGNAL(requestContextMenu(const QPoint
&, const QPoint
&)),
116 this, SLOT(openContextMenu(const QPoint
&, const QPoint
&)));
117 connect(m_controller
, SIGNAL(sortingChanged(DolphinView::Sorting
)),
118 this, SLOT(updateSorting(DolphinView::Sorting
)));
119 connect(m_controller
, SIGNAL(sortOrderChanged(Qt::SortOrder
)),
120 this, SLOT(updateSortOrder(Qt::SortOrder
)));
121 connect(m_controller
, SIGNAL(itemTriggered(const QModelIndex
&)),
122 this, SLOT(triggerItem(const QModelIndex
&)));
123 connect(m_controller
, SIGNAL(selectionChanged()),
124 this, SLOT(emitSelectionChangedSignal()));
125 connect(m_controller
, SIGNAL(activated()),
126 this, SLOT(requestActivation()));
130 m_iconSize
= K3Icon::SizeMedium
;
132 m_filterBar
= new FilterBar(this);
134 connect(m_filterBar
, SIGNAL(filterChanged(const QString
&)),
135 this, SLOT(changeNameFilter(const QString
&)));
136 connect(m_filterBar
, SIGNAL(closeRequest()),
137 this, SLOT(closeFilterBar()));
139 m_topLayout
->addWidget(m_urlNavigator
);
140 m_topLayout
->addWidget(itemView());
141 m_topLayout
->addWidget(m_filterBar
);
142 m_topLayout
->addWidget(m_statusBar
);
144 loadDirectory(m_urlNavigator
->url());
147 DolphinView::~DolphinView()
153 void DolphinView::setUrl(const KUrl
& url
)
155 m_urlNavigator
->setUrl(url
);
156 m_controller
->setUrl(url
);
159 const KUrl
& DolphinView::url() const
161 return m_urlNavigator
->url();
164 bool DolphinView::isActive() const
166 return (mainWindow()->activeView() == this);
169 void DolphinView::setMode(Mode mode
)
171 if (mode
== m_mode
) {
172 return; // the wished mode is already set
177 ViewProperties
props(m_urlNavigator
->url());
178 props
.setViewMode(m_mode
);
181 startDirLister(m_urlNavigator
->url());
186 DolphinView::Mode
DolphinView::mode() const
191 void DolphinView::setShowPreview(bool show
)
193 ViewProperties
props(m_urlNavigator
->url());
194 props
.setShowPreview(show
);
196 // TODO: wait until previews are possible with KFileItemDelegate
198 emit
showPreviewChanged();
201 bool DolphinView::showPreview() const
203 // TODO: wait until previews are possible with KFileItemDelegate
207 void DolphinView::setShowHiddenFiles(bool show
)
209 if (m_dirLister
->showingDotFiles() == show
) {
213 ViewProperties
props(m_urlNavigator
->url());
214 props
.setShowHiddenFiles(show
);
217 m_dirLister
->setShowingDotFiles(show
);
219 emit
showHiddenFilesChanged();
224 bool DolphinView::showHiddenFiles() const
226 return m_dirLister
->showingDotFiles();
229 void DolphinView::renameSelectedItems()
231 const KUrl::List urls
= selectedUrls();
232 if (urls
.count() > 1) {
233 // More than one item has been selected for renaming. Open
234 // a rename dialog and rename all items afterwards.
235 RenameDialog
dialog(urls
);
236 if (dialog
.exec() == QDialog::Rejected
) {
240 DolphinView
* view
= mainWindow()->activeView();
241 const QString
& newName
= dialog
.newName();
242 if (newName
.isEmpty()) {
243 view
->statusBar()->setMessage(i18n("The new item name is invalid."),
244 DolphinStatusBar::Error
);
247 // TODO: check how this can be integrated into KonqUndoManager/KonqOperations
249 //UndoManager& undoMan = UndoManager::instance();
250 //undoMan.beginMacro();
252 assert(newName
.contains('#'));
254 const int urlsCount
= urls
.count();
256 // iterate through all selected items and rename them...
257 const int replaceIndex
= newName
.indexOf('#');
258 assert(replaceIndex
>= 0);
259 for (int i
= 0; i
< urlsCount
; ++i
) {
260 const KUrl
& source
= urls
[i
];
262 number
.setNum(i
+ 1);
264 QString
name(newName
);
265 name
.replace(replaceIndex
, 1, number
);
267 if (source
.fileName() != name
) {
268 KUrl
dest(source
.upUrl());
271 const bool destExists
= KIO::NetAccess::exists(dest
, false, view
);
273 view
->statusBar()->setMessage(i18n("Renaming failed (item '%1' already exists).",name
),
274 DolphinStatusBar::Error
);
277 else if (KIO::NetAccess::file_move(source
, dest
)) {
278 // TODO: From the users point of view he executed one 'rename n files' operation,
279 // but internally we store it as n 'rename 1 file' operations for the undo mechanism.
280 //DolphinCommand command(DolphinCommand::Rename, source, dest);
281 //undoMan.addCommand(command);
286 //undoMan.endMacro();
290 // Only one item has been selected for renaming. Use the custom
291 // renaming mechanism from the views.
292 assert(urls
.count() == 1);
294 /*if (m_mode == DetailsView) {
295 Q3ListViewItem* item = m_iconsView->firstChild();
297 if (item->isSelected()) {
298 m_iconsView->rename(item, DolphinDetailsView::NameColumn);
301 item = item->nextSibling();
305 KFileIconViewItem* item = static_cast<KFileIconViewItem*>(m_iconsView->firstItem());
307 if (item->isSelected()) {
311 item = static_cast<KFileIconViewItem*>(item->nextItem());
317 void DolphinView::selectAll()
319 selectAll(QItemSelectionModel::Select
);
322 void DolphinView::invertSelection()
324 selectAll(QItemSelectionModel::Toggle
);
327 DolphinStatusBar
* DolphinView::statusBar() const
332 int DolphinView::contentsX() const
335 return itemView()->horizontalScrollBar()->value();
338 int DolphinView::contentsY() const
340 return itemView()->verticalScrollBar()->value();
343 void DolphinView::refreshSettings()
345 startDirLister(m_urlNavigator
->url());
348 void DolphinView::emitRequestItemInfo(const KUrl
& url
)
350 emit
requestItemInfo(url
);
353 bool DolphinView::isFilterBarVisible() const
355 return m_filterBar
->isVisible();
358 bool DolphinView::isUrlEditable() const
360 return m_urlNavigator
->isUrlEditable();
363 void DolphinView::zoomIn()
365 //itemEffectsManager()->zoomIn();
368 void DolphinView::zoomOut()
370 //itemEffectsManager()->zoomOut();
373 bool DolphinView::isZoomInPossible() const
375 return false; //itemEffectsManager()->isZoomInPossible();
378 bool DolphinView::isZoomOutPossible() const
380 return false; //itemEffectsManager()->isZoomOutPossible();
383 void DolphinView::setSorting(Sorting sorting
)
385 if (sorting
!= this->sorting()) {
386 updateSorting(sorting
);
390 DolphinView::Sorting
DolphinView::sorting() const
392 return m_proxyModel
->sorting();
395 void DolphinView::setSortOrder(Qt::SortOrder order
)
397 if (sortOrder() != order
) {
398 updateSortOrder(order
);
402 Qt::SortOrder
DolphinView::sortOrder() const
404 return m_proxyModel
->sortOrder();
407 void DolphinView::goBack()
409 m_urlNavigator
->goBack();
412 void DolphinView::goForward()
414 m_urlNavigator
->goForward();
417 void DolphinView::goUp()
419 m_urlNavigator
->goUp();
422 void DolphinView::goHome()
424 m_urlNavigator
->goHome();
427 void DolphinView::setUrlEditable(bool editable
)
429 m_urlNavigator
->editUrl(editable
);
432 const QLinkedList
<UrlNavigator::HistoryElem
> DolphinView::urlHistory(int& index
) const
434 return m_urlNavigator
->history(index
);
437 bool DolphinView::hasSelection() const
439 return itemView()->selectionModel()->hasSelection();
442 KFileItemList
DolphinView::selectedItems() const
444 const QAbstractItemView
* view
= itemView();
446 // Our view has a selection, we will map them back to the DirModel
447 // and then fill the KFileItemList.
448 assert((view
!= 0) && (view
->selectionModel() != 0));
450 const QItemSelection selection
= m_proxyModel
->mapSelectionToSource(view
->selectionModel()->selection());
451 KFileItemList itemList
;
453 const QModelIndexList indexList
= selection
.indexes();
454 QModelIndexList::const_iterator end
= indexList
.end();
455 for (QModelIndexList::const_iterator it
= indexList
.begin(); it
!= end
; ++it
) {
456 assert((*it
).isValid());
458 KFileItem
* item
= m_dirModel
->itemForIndex(*it
);
460 itemList
.append(item
);
467 KUrl::List
DolphinView::selectedUrls() const
471 const KFileItemList list
= selectedItems();
472 KFileItemList::const_iterator it
= list
.begin();
473 const KFileItemList::const_iterator end
= list
.end();
475 KFileItem
* item
= *it
;
476 urls
.append(item
->url());
483 KFileItem
* DolphinView::fileItem(const QModelIndex index
) const
485 const QModelIndex dirModelIndex
= m_proxyModel
->mapToSource(index
);
486 return m_dirModel
->itemForIndex(dirModelIndex
);
489 void DolphinView::rename(const KUrl
& source
, const QString
& newName
)
493 if (newName
.isEmpty() || (source
.fileName() == newName
)) {
497 KUrl
dest(source
.upUrl());
498 dest
.addPath(newName
);
500 const bool destExists
= KIO::NetAccess::exists(dest
,
502 mainWindow()->activeView());
504 // the destination already exists, hence ask the user
506 KIO::RenameDialog
renameDialog(this,
507 i18n("File Already Exists"),
511 switch (renameDialog
.exec()) {
512 case KIO::R_OVERWRITE
:
513 // the destination should be overwritten
514 ok
= KIO::NetAccess::file_move(source
, dest
, -1, true);
517 case KIO::R_RENAME
: {
518 // a new name for the destination has been used
519 KUrl
newDest(renameDialog
.newDestUrl());
520 ok
= KIO::NetAccess::file_move(source
, newDest
);
525 // the renaming operation has been canceled
531 // no destination exists, hence just move the file to
533 ok
= KIO::NetAccess::file_move(source
, dest
);
536 const QString destFileName
= dest
.fileName();
538 m_statusBar
->setMessage(i18n("Renamed file '%1' to '%2'.",source
.fileName(), destFileName
),
539 DolphinStatusBar::OperationCompleted
);
541 KonqOperations::rename(this, source
, destFileName
);
544 m_statusBar
->setMessage(i18n("Renaming of file '%1' to '%2' failed.",source
.fileName(), destFileName
),
545 DolphinStatusBar::Error
);
550 void DolphinView::reload()
552 startDirLister(m_urlNavigator
->url(), true);
555 void DolphinView::declareViewActive()
557 mainWindow()->setActiveView( this );
560 void DolphinView::mouseReleaseEvent(QMouseEvent
* event
)
562 QWidget::mouseReleaseEvent(event
);
563 mainWindow()->setActiveView(this);
566 DolphinMainWindow
* DolphinView::mainWindow() const
571 void DolphinView::loadDirectory(const KUrl
& url
)
573 const ViewProperties
props(url
);
575 const Mode mode
= props
.viewMode();
576 if (m_mode
!= mode
) {
582 const bool showHiddenFiles
= props
.showHiddenFiles();
583 if (showHiddenFiles
!= m_dirLister
->showingDotFiles()) {
584 m_dirLister
->setShowingDotFiles(showHiddenFiles
);
585 emit
showHiddenFilesChanged();
588 const DolphinView::Sorting sorting
= props
.sorting();
589 if (sorting
!= m_proxyModel
->sorting()) {
590 m_proxyModel
->setSorting(sorting
);
591 emit
sortingChanged(sorting
);
594 const Qt::SortOrder sortOrder
= props
.sortOrder();
595 if (sortOrder
!= m_proxyModel
->sortOrder()) {
596 m_proxyModel
->setSortOrder(sortOrder
);
597 emit
sortOrderChanged(sortOrder
);
600 // TODO: handle previews (props.showPreview())
603 emit
urlChanged(url
);
605 m_statusBar
->clear();
608 void DolphinView::triggerItem(const QModelIndex
& index
)
610 const Qt::KeyboardModifiers modifier
= QApplication::keyboardModifiers();
611 if ((modifier
& Qt::ShiftModifier
) || (modifier
& Qt::ControlModifier
)) {
612 // items are selected by the user, hence don't trigger the
613 // item specified by 'index'
617 KFileItem
* item
= m_dirModel
->itemForIndex(m_proxyModel
->mapToSource(index
));
623 // Prefer the local path over the URL. This assures that the
624 // volume space information is correct. Assuming that the URL is media:/sda1,
625 // and the local path is /windows/C: For the URL the space info is related
626 // to the root partition (and hence wrong) and for the local path the space
627 // info is related to the windows partition (-> correct).
628 const QString
localPath(item
->localPath());
629 if (localPath
.isEmpty()) {
633 setUrl(KUrl(localPath
));
641 void DolphinView::updateProgress(int percent
)
643 if (m_showProgress
) {
644 m_statusBar
->setProgress(percent
);
648 void DolphinView::updateItemCount()
650 if (m_showProgress
) {
651 m_statusBar
->setProgressText(QString::null
);
652 m_statusBar
->setProgress(100);
653 m_showProgress
= false;
656 KFileItemList
items(m_dirLister
->items());
657 KFileItemList::const_iterator it
= items
.begin();
658 const KFileItemList::const_iterator end
= items
.end();
664 KFileItem
* item
= *it
;
676 QTimer::singleShot(0, this, SLOT(restoreContentsPos()));
679 void DolphinView::restoreContentsPos()
682 const QLinkedList
<UrlNavigator::HistoryElem
> history
= urlHistory(index
);
683 if (!history
.isEmpty()) {
684 QAbstractItemView
* view
= itemView();
685 // TODO: view->setCurrentItem(history[index].currentFileName());
687 QLinkedList
<UrlNavigator::HistoryElem
>::const_iterator it
= history
.begin();
689 view
->horizontalScrollBar()->setValue((*it
).contentsX());
690 view
->verticalScrollBar()->setValue((*it
).contentsY());
694 void DolphinView::showInfoMessage(const QString
& msg
)
696 m_statusBar
->setMessage(msg
, DolphinStatusBar::Information
);
699 void DolphinView::showErrorMessage(const QString
& msg
)
701 m_statusBar
->setMessage(msg
, DolphinStatusBar::Error
);
704 void DolphinView::emitSelectionChangedSignal()
706 emit
selectionChanged();
709 void DolphinView::closeFilterBar()
712 emit
showFilterBarChanged(false);
715 void DolphinView::startDirLister(const KUrl
& url
, bool reload
)
717 if (!url
.isValid()) {
718 const QString
location(url
.pathOrUrl());
719 if (location
.isEmpty()) {
720 m_statusBar
->setMessage(i18n("The location is empty."), DolphinStatusBar::Error
);
723 m_statusBar
->setMessage(i18n("The location '%1' is invalid.",location
),
724 DolphinStatusBar::Error
);
729 // Only show the directory loading progress if the status bar does
730 // not contain another progress information. This means that
731 // the directory loading progress information has the lowest priority.
732 const QString
progressText(m_statusBar
->progressText());
733 m_showProgress
= progressText
.isEmpty() ||
734 (progressText
== i18n("Loading directory..."));
735 if (m_showProgress
) {
736 m_statusBar
->setProgressText(i18n("Loading directory..."));
737 m_statusBar
->setProgress(0);
741 m_dirLister
->openUrl(url
, false, reload
);
744 QString
DolphinView::defaultStatusBarText() const
746 return KIO::itemsSummaryString(m_fileCount
+ m_folderCount
,
752 QString
DolphinView::selectionStatusBarText() const
755 const KFileItemList list
= selectedItems();
756 if (list
.isEmpty()) {
757 // when an item is triggered, it is temporary selected but selectedItems()
758 // will return an empty list
764 KIO::filesize_t byteSize
= 0;
765 KFileItemList::const_iterator it
= list
.begin();
766 const KFileItemList::const_iterator end
= list
.end();
768 KFileItem
* item
= *it
;
774 byteSize
+= item
->size();
779 if (folderCount
> 0) {
780 text
= i18np("1 Folder selected", "%1 Folders selected", folderCount
);
787 const QString
sizeText(KIO::convertSize(byteSize
));
788 text
+= i18np("1 File selected (%2)", "%1 Files selected (%2)", fileCount
, sizeText
);
794 void DolphinView::showFilterBar(bool show
)
796 assert(m_filterBar
!= 0);
805 void DolphinView::updateStatusBar()
807 // As the item count information is less important
808 // in comparison with other messages, it should only
810 // - the status bar is empty or
811 // - shows already the item count information or
812 // - shows only a not very important information
813 // - if any progress is given don't show the item count info at all
814 const QString
msg(m_statusBar
->message());
815 const bool updateStatusBarMsg
= (msg
.isEmpty() ||
816 (msg
== m_statusBar
->defaultText()) ||
817 (m_statusBar
->type() == DolphinStatusBar::Information
)) &&
818 (m_statusBar
->progress() == 100);
820 const QString
text(hasSelection() ? selectionStatusBarText() : defaultStatusBarText());
821 m_statusBar
->setDefaultText(text
);
823 if (updateStatusBarMsg
) {
824 m_statusBar
->setMessage(text
, DolphinStatusBar::Default
);
828 void DolphinView::requestActivation()
830 m_mainWindow
->setActiveView(this);
833 void DolphinView::changeNameFilter(const QString
& nameFilter
)
835 // The name filter of KDirLister does a 'hard' filtering, which
836 // means that only the items are shown where the names match
837 // exactly the filter. This is non-transparent for the user, which
838 // just wants to have a 'soft' filtering: does the name contain
839 // the filter string?
840 QString
adjustedFilter(nameFilter
);
841 adjustedFilter
.insert(0, '*');
842 adjustedFilter
.append('*');
844 // Use the ProxyModel to filter:
845 // This code is #ifdefed as setNameFilter behaves
846 // slightly different than the QSortFilterProxyModel
847 // as it will not remove directories. I will ask
848 // our beloved usability experts for input
851 m_dirLister
->setNameFilter(adjustedFilter
);
852 m_dirLister
->emitChanges();
854 m_proxyModel
->setFilterRegExp( nameFilter
);
858 void DolphinView::openContextMenu(const QPoint
& pos
, const QPoint
& globalPos
)
862 const QModelIndex index
= itemView()->indexAt(pos
);
863 if (index
.isValid()) {
864 item
= fileItem(index
);
867 DolphinContextMenu
contextMenu(this, item
, globalPos
);
871 void DolphinView::updateSorting(DolphinView::Sorting sorting
)
873 ViewProperties
props(url());
874 props
.setSorting(sorting
);
876 m_proxyModel
->setSorting(sorting
);
878 emit
sortingChanged(sorting
);
881 void DolphinView::updateSortOrder(Qt::SortOrder order
)
883 ViewProperties
props(url());
884 props
.setSortOrder(order
);
886 m_proxyModel
->setSortOrder(order
);
888 emit
sortOrderChanged(order
);
891 void DolphinView::createView()
893 // delete current view
894 QAbstractItemView
* view
= itemView();
896 m_topLayout
->removeWidget(view
);
903 assert(m_iconsView
== 0);
904 assert(m_detailsView
== 0);
906 // ... and recreate it representing the current mode
909 m_iconsView
= new DolphinIconsView(this, m_controller
);
914 m_detailsView
= new DolphinDetailsView(this, m_controller
);
915 view
= m_detailsView
;
919 view
->setModel(m_proxyModel
);
920 view
->setSelectionMode(QAbstractItemView::ExtendedSelection
);
922 KFileItemDelegate
* delegate
= new KFileItemDelegate(this);
923 delegate
->setAdditionalInformation(KFileItemDelegate::FriendlyMimeType
);
924 view
->setItemDelegate(delegate
);
926 new KMimeTypeResolver(view
, m_dirModel
);
927 m_topLayout
->insertWidget(1, view
);
929 connect(view
->selectionModel(), SIGNAL(selectionChanged(const QItemSelection
&, const QItemSelection
&)),
930 m_controller
, SLOT(indicateSelectionChange()));
933 int DolphinView::columnIndex(Sorting sorting
) const
937 case SortByName
: index
= KDirModel::Name
; break;
938 case SortBySize
: index
= KDirModel::Size
; break;
939 case SortByDate
: index
= KDirModel::ModifiedTime
; break;
940 default: assert(false);
945 void DolphinView::selectAll(QItemSelectionModel::SelectionFlags flags
)
947 QItemSelectionModel
* selectionModel
= itemView()->selectionModel();
948 const QAbstractItemModel
* itemModel
= selectionModel
->model();
950 const QModelIndex topLeft
= itemModel
->index(0, 0);
951 const QModelIndex bottomRight
= itemModel
->index(itemModel
->rowCount() - 1,
952 itemModel
->columnCount() - 1);
954 QItemSelection
selection(topLeft
, bottomRight
);
955 selectionModel
->select(selection
, flags
);
958 QAbstractItemView
* DolphinView::itemView() const
960 assert((m_iconsView
== 0) || (m_detailsView
== 0));
961 if (m_detailsView
!= 0) {
962 return m_detailsView
;
967 #include "dolphinview.moc"