- m_urlNavigator = new UrlNavigator(url, this);
- connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
- this, SLOT(loadDirectory(const KUrl&)));
-
- m_statusBar = new DolphinStatusBar(this);
-
- m_dirLister = new DolphinDirLister();
- m_dirLister->setAutoUpdate(true);
- m_dirLister->setMainWindow(this);
- m_dirLister->setShowingDotFiles(showHiddenFiles);
- m_dirLister->setDelayedMimeTypes(true);
-
- connect(m_dirLister, SIGNAL(clear()),
- this, SLOT(updateStatusBar()));
- connect(m_dirLister, SIGNAL(percent(int)),
- this, SLOT(updateProgress(int)));
- connect(m_dirLister, SIGNAL(deleteItem(KFileItem*)),
- this, SLOT(updateStatusBar()));
- connect(m_dirLister, SIGNAL(completed()),
- this, SLOT(updateItemCount()));
- connect(m_dirLister, SIGNAL(infoMessage(const QString&)),
- this, SLOT(showInfoMessage(const QString&)));
- connect(m_dirLister, SIGNAL(errorMessage(const QString&)),
- this, SLOT(showErrorMessage(const QString&)));
-
- m_dirModel = new KDirModel();
- m_dirModel->setDirLister(m_dirLister);
- m_dirModel->setDropsAllowed(KDirModel::DropOnDirectory);
-
- m_proxyModel = new DolphinSortFilterProxyModel(this);
- m_proxyModel->setSourceModel(m_dirModel);
-
- createView();
-
- m_iconSize = K3Icon::SizeMedium;
-
- m_filterBar = new FilterBar(this);
- m_filterBar->hide();
- connect(m_filterBar, SIGNAL(filterChanged(const QString&)),
- this, SLOT(changeNameFilter(const QString&)));
- connect(m_filterBar, SIGNAL(closeRequest()),
- this, SLOT(closeFilterBar()));
-
- m_topLayout->addWidget(m_urlNavigator);
- m_topLayout->addWidget(itemView());
- m_topLayout->addWidget(m_filterBar);
- m_topLayout->addWidget(m_statusBar);
+ m_controller = new DolphinController(this);
+ m_controller->setUrl(url);
+
+ connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
+ this, SIGNAL(urlChanged(const KUrl&)));
+
+ connect(m_controller, SIGNAL(requestContextMenu(const QPoint&, const QList<QAction*>&)),
+ this, SLOT(openContextMenu(const QPoint&, const QList<QAction*>&)));
+ connect(m_controller, SIGNAL(urlsDropped(const KFileItem&, const KUrl&, QDropEvent*)),
+ this, SLOT(dropUrls(const KFileItem&, const KUrl&, QDropEvent*)));
+ 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(sortFoldersFirstChanged(bool)),
+ this, SLOT(updateSortFoldersFirst(bool)));
+ 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(tabRequested(const KUrl&)),
+ this, SIGNAL(tabRequested(const KUrl&)));
+ 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()));
+
+ KDirLister* dirLister = m_viewAccessor.dirLister();
+ connect(dirLister, SIGNAL(redirection(KUrl,KUrl)),
+ this, SLOT(slotRedirection(KUrl,KUrl)));
+ connect(dirLister, SIGNAL(completed()),
+ this, SLOT(slotDirListerCompleted()));
+ connect(dirLister, SIGNAL(refreshItems(const QList<QPair<KFileItem,KFileItem>>&)),
+ this, SLOT(slotRefreshItems()));
+
+ // When a new item has been created by the "Create New..." menu, the item should
+ // get selected and it must be assured that the item will get visible. As the
+ // creation is done asynchronously, several signals must be checked:
+ connect(&DolphinNewMenuObserver::instance(), SIGNAL(itemCreated(const KUrl&)),
+ this, SLOT(observeCreatedItem(const KUrl&)));
+
+ m_selectionChangedTimer = new QTimer(this);
+ m_selectionChangedTimer->setSingleShot(true);
+ m_selectionChangedTimer->setInterval(300);
+ connect(m_selectionChangedTimer, SIGNAL(timeout()),
+ this, SLOT(emitSelectionChangedSignal()));