- m_iconsView->setModel(m_proxyModel);
-
- KFileItemDelegate* delegate = new KFileItemDelegate(this);
- delegate->setAdditionalInformation(KFileItemDelegate::FriendlyMimeType);
- m_iconsView->setItemDelegate(delegate);
-
- m_dirLister->setDelayedMimeTypes(true);
- new KMimeTypeResolver(m_iconsView, m_dirModel);
-
- m_iconSize = K3Icon::SizeMedium;
-
- m_filterBar = new FilterBar(this);
- m_filterBar->hide();
- connect(m_filterBar, SIGNAL(filterChanged(const QString&)),
- this, SLOT(slotChangeNameFilter(const QString&)));
- connect(m_filterBar, SIGNAL(closed()),
- this, SLOT(closeFilterBar()));
-
- m_topLayout->addWidget(m_urlNavigator);
- m_topLayout->addWidget(m_iconsView);
- m_topLayout->addWidget(m_filterBar);
- m_topLayout->addWidget(m_statusBar);
-
- connect(m_iconsView, SIGNAL(clicked(const QModelIndex&)),
- this, SLOT(triggerItem(const QModelIndex&)));
- connect(m_iconsView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
- this, SLOT(emitSelectionChangedSignal()));
-
- loadDirectory(m_urlNavigator->url());
+ connect(m_dirLister, SIGNAL(completed()),
+ this, SLOT(updateCutItems()));
+ connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
+ this, SLOT(generatePreviews(const KFileItemList&)));
+
+ m_controller = new DolphinController(this);
+ m_controller->setUrl(url);
+
+ // Receiver of the DolphinView signal 'urlChanged()' don't need
+ // to care whether the internal controller changed the URL already or whether
+ // the controller just requested an URL change and will be updated later.
+ // In both cases the URL has been changed:
+ connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
+ this, SIGNAL(urlChanged(const KUrl&)));
+ connect(m_controller, SIGNAL(requestUrlChange(const KUrl&)),
+ this, SIGNAL(urlChanged(const KUrl&)));
+
+ connect(m_controller, SIGNAL(requestContextMenu(const QPoint&)),
+ this, SLOT(openContextMenu(const QPoint&)));
+ connect(m_controller, SIGNAL(urlsDropped(const KUrl::List&, const KUrl&, const KFileItem&)),
+ this, SLOT(dropUrls(const KUrl::List&, const KUrl&, const KFileItem&)));
+ connect(m_controller, SIGNAL(sortingChanged(DolphinView::Sorting)),
+ this, SLOT(updateSorting(DolphinView::Sorting)));
+ connect(m_controller, SIGNAL(sortOrderChanged(Qt::SortOrder)),
+ this, SLOT(updateSortOrder(Qt::SortOrder)));
+ connect(m_controller, SIGNAL(additionalInfoChanged(const KFileItemDelegate::InformationList&)),
+ this, SLOT(updateAdditionalInfo(const KFileItemDelegate::InformationList&)));
+ connect(m_controller, SIGNAL(itemTriggered(const KFileItem&)),
+ this, SLOT(triggerItem(const KFileItem&)));
+ connect(m_controller, SIGNAL(activated()),
+ this, SLOT(activate()));
+ connect(m_controller, SIGNAL(itemEntered(const KFileItem&)),
+ this, SLOT(showHoverInformation(const KFileItem&)));
+ connect(m_controller, SIGNAL(viewportEntered()),
+ this, SLOT(clearHoverInformation()));
+
+ applyViewProperties(url);
+ m_topLayout->addWidget(itemView());