- m_topLayout = new Q3VBoxLayout(this);
-
- Dolphin& dolphin = Dolphin::mainWin();
-
- connect(this, SIGNAL(signalModeChanged()),
- &dolphin, SLOT(slotViewModeChanged()));
- connect(this, SIGNAL(signalShowHiddenFilesChanged()),
- &dolphin, SLOT(slotShowHiddenFilesChanged()));
- connect(this, SIGNAL(signalSortingChanged(DolphinView::Sorting)),
- &dolphin, SLOT(slotSortingChanged(DolphinView::Sorting)));
- connect(this, SIGNAL(signalSortOrderChanged(Qt::SortOrder)),
- &dolphin, SLOT(slotSortOrderChanged(Qt::SortOrder)));
-
- m_urlNavigator = new UrlNavigator(url, this);
- connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
- this, SLOT(slotUrlChanged(const KUrl&)));
- connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
- &dolphin, SLOT(slotUrlChanged(const KUrl&)));
- connect(m_urlNavigator, SIGNAL(historyChanged()),
- &dolphin, SLOT(slotHistoryChanged()));
-
- m_statusBar = new DolphinStatusBar(this);
-
- m_dirLister = new DolphinDirLister();
- m_dirLister->setAutoUpdate(true);
- m_dirLister->setMainWindow(this);
- m_dirLister->setShowingDotFiles(showHiddenFiles);
- connect(m_dirLister, SIGNAL(clear()),
- this, SLOT(slotClear()));
- connect(m_dirLister, SIGNAL(percent(int)),
- this, SLOT(slotPercent(int)));
- connect(m_dirLister, SIGNAL(deleteItem(KFileItem*)),
- this, SLOT(slotDeleteItem(KFileItem*)));
- connect(m_dirLister, SIGNAL(completed()),
- this, SLOT(slotCompleted()));
- connect(m_dirLister, SIGNAL(infoMessage(const QString&)),
- this, SLOT(slotInfoMessage(const QString&)));
- connect(m_dirLister, SIGNAL(errorMessage(const QString&)),
- this, SLOT(slotErrorMessage(const QString&)));
- connect(m_dirLister, SIGNAL(refreshItems(const KFileItemList&)),
- this, SLOT(slotRefreshItems(const KFileItemList&)));
- connect(m_dirLister, SIGNAL(redirection(const KUrl&, const KUrl&)),
- this, SIGNAL(redirection(const KUrl&, const KUrl&)));
- connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
- this, SLOT(slotAddItems(const KFileItemList&)));
-
- m_iconSize = K3Icon::SizeMedium;
-
- m_topLayout->addWidget(m_urlNavigator);
- createView();
-
- m_filterBar = new FilterBar(this);
- m_filterBar->hide();
- m_topLayout->addWidget(m_filterBar);
- connect(m_filterBar, SIGNAL(signalFilterChanged(const QString&)),
- this, SLOT(slotChangeNameFilter(const QString&)));
-
- m_topLayout->addWidget(m_statusBar);
+ m_topLayout = new QVBoxLayout(this);
+ m_topLayout->setSpacing(0);
+ m_topLayout->setMargin(0);
+
+ 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(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()));
+
+ applyViewProperties(url);
+ m_topLayout->addWidget(itemView());