- connect(m_view, SIGNAL(urlChanged(KUrl)), m_urlNavigator, SLOT(setUrl(KUrl)));
- connect(m_view, SIGNAL(writeStateChanged(bool)), this, SIGNAL(writeStateChanged(bool)));
- connect(m_view, SIGNAL(requestItemInfo(KFileItem)), this, SLOT(showItemInfo(KFileItem)));
- connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString)));
- connect(m_view, SIGNAL(infoMessage(QString)), this, SLOT(showInfoMessage(QString)));
- connect(m_view, SIGNAL(itemActivated(KFileItem)), this, SLOT(slotItemActivated(KFileItem)));
- connect(m_view, SIGNAL(redirection(KUrl,KUrl)), this, SLOT(redirect(KUrl,KUrl)));
- connect(m_view, SIGNAL(startedPathLoading(KUrl)), this, SLOT(slotStartedPathLoading()));
- connect(m_view, SIGNAL(finishedPathLoading(KUrl)), this, SLOT(slotFinishedPathLoading()));
- connect(m_view, SIGNAL(itemCountChanged()), this, SLOT(delayedStatusBarUpdate()));
- connect(m_view, SIGNAL(pathLoadingProgress(int)), this, SLOT(updateProgress(int)));
- connect(m_view, SIGNAL(infoMessage(QString)), this, SLOT(showInfoMessage(QString)));
- connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString)));
- connect(m_view, SIGNAL(urlIsFileError(KUrl)), this, SLOT(openFile(KUrl)));
- connect(m_view, SIGNAL(selectionChanged(KFileItemList)), this, SLOT(delayedStatusBarUpdate()));
- connect(m_view, SIGNAL(operationCompletedMessage(QString)), this, SLOT(showOperationCompletedMessage(QString)));
- connect(m_view, SIGNAL(urlAboutToBeChanged(KUrl)), this, SLOT(slotViewUrlAboutToBeChanged(KUrl)));
-
- connect(m_urlNavigator, SIGNAL(urlAboutToBeChanged(KUrl)),
- this, SLOT(slotUrlNavigatorLocationAboutToBeChanged(KUrl)));
- connect(m_urlNavigator, SIGNAL(urlChanged(KUrl)),
- this, SLOT(slotUrlNavigatorLocationChanged(KUrl)));
- connect(m_urlNavigator, SIGNAL(historyChanged()),
- this, SLOT(slotHistoryChanged()));
-
- // initialize status bar
- m_statusBar = new DolphinStatusBar(this, m_view);
- connect(m_statusBar, SIGNAL(stopPressed()), this, SLOT(stopLoading()));
+ connect(m_view, &DolphinView::urlChanged,
+ m_urlNavigator, &KUrlNavigator::setLocationUrl);
+ connect(m_view, &DolphinView::urlChanged,
+ m_messageWidget, &KMessageWidget::hide);
+ connect(m_view, &DolphinView::writeStateChanged,
+ this, &DolphinViewContainer::writeStateChanged);
+ connect(m_view, &DolphinView::requestItemInfo,
+ this, &DolphinViewContainer::showItemInfo);
+ connect(m_view, &DolphinView::itemActivated,
+ this, &DolphinViewContainer::slotItemActivated);
+ connect(m_view, &DolphinView::itemsActivated,
+ this, &DolphinViewContainer::slotItemsActivated);
+ connect(m_view, &DolphinView::redirection,
+ this, &DolphinViewContainer::redirect);
+ connect(m_view, &DolphinView::directoryLoadingStarted,
+ this, &DolphinViewContainer::slotDirectoryLoadingStarted);
+ connect(m_view, &DolphinView::directoryLoadingCompleted,
+ this, &DolphinViewContainer::slotDirectoryLoadingCompleted);
+ connect(m_view, &DolphinView::directoryLoadingCanceled,
+ this, &DolphinViewContainer::slotDirectoryLoadingCanceled);
+ connect(m_view, &DolphinView::itemCountChanged,
+ this, &DolphinViewContainer::delayedStatusBarUpdate);
+ connect(m_view, &DolphinView::directoryLoadingProgress,
+ this, &DolphinViewContainer::updateDirectoryLoadingProgress);
+ connect(m_view, &DolphinView::directorySortingProgress,
+ this, &DolphinViewContainer::updateDirectorySortingProgress);
+ connect(m_view, &DolphinView::selectionChanged,
+ this, &DolphinViewContainer::delayedStatusBarUpdate);
+ connect(m_view, &DolphinView::errorMessage,
+ this, &DolphinViewContainer::showErrorMessage);
+ connect(m_view, &DolphinView::urlIsFileError,
+ this, &DolphinViewContainer::slotUrlIsFileError);
+ connect(m_view, &DolphinView::activated,
+ this, &DolphinViewContainer::activate);
+
+ connect(m_urlNavigator, &KUrlNavigator::urlAboutToBeChanged,
+ this, &DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged);
+ connect(m_urlNavigator, &KUrlNavigator::urlChanged,
+ this, &DolphinViewContainer::slotUrlNavigatorLocationChanged);
+ connect(m_urlNavigator, &KUrlNavigator::urlSelectionRequested,
+ this, &DolphinViewContainer::slotUrlSelectionRequested);
+ connect(m_urlNavigator, &KUrlNavigator::returnPressed,
+ this, &DolphinViewContainer::slotReturnPressed);
+ connect(m_urlNavigator, &KUrlNavigator::urlsDropped, this, [=](const QUrl &destination, QDropEvent *event) {
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 37, 0)
+ m_view->dropUrls(destination, event, m_urlNavigator->dropWidget());
+#else
+ // TODO: remove as soon as we can hard-depend of KF5 >= 5.37
+ m_view->dropUrls(destination, event, m_view);
+#endif
+ });
+
+ // Initialize status bar
+ m_statusBar = new DolphinStatusBar(this);
+ m_statusBar->setUrl(m_view->url());
+ m_statusBar->setZoomLevel(m_view->zoomLevel());
+ connect(m_view, &DolphinView::urlChanged,
+ m_statusBar, &DolphinStatusBar::setUrl);
+ connect(m_view, &DolphinView::zoomLevelChanged,
+ m_statusBar, &DolphinStatusBar::setZoomLevel);
+ connect(m_view, &DolphinView::infoMessage,
+ m_statusBar, &DolphinStatusBar::setText);
+ connect(m_view, &DolphinView::operationCompletedMessage,
+ m_statusBar, &DolphinStatusBar::setText);
+ connect(m_statusBar, &DolphinStatusBar::stopPressed,
+ this, &DolphinViewContainer::stopDirectoryLoading);
+ connect(m_statusBar, &DolphinStatusBar::zoomLevelChanged,
+ this, &DolphinViewContainer::slotStatusBarZoomLevelChanged);