- setXMLFile("dolphinpart.rc");
-
- connect(m_view, SIGNAL(infoMessage(QString)),
- this, SLOT(slotInfoMessage(QString)));
- connect(m_view, SIGNAL(errorMessage(QString)),
- this, SLOT(slotErrorMessage(QString)));
- connect(m_view, SIGNAL(itemTriggered(KFileItem)),
- this, SLOT(slotItemTriggered(KFileItem)));
- connect(m_view, SIGNAL(requestContextMenu(KFileItem,KUrl)),
- this, SLOT(slotOpenContextMenu(KFileItem,KUrl)));
- connect(m_view, SIGNAL(selectionChanged(KFileItemList)),
- m_extension, SIGNAL(selectionInfo(KFileItemList)));
- connect(m_view, SIGNAL(selectionChanged(KFileItemList)),
- this, SLOT(slotSelectionChanged(KFileItemList)));
- connect(m_view, SIGNAL(requestItemInfo(KFileItem)),
- this, SLOT(slotRequestItemInfo(KFileItem)));
- connect(m_view, SIGNAL(urlChanged(KUrl)),
- this, SLOT(slotUrlChanged(KUrl)));
- connect(m_view, SIGNAL(modeChanged()),
- this, SLOT(updateViewActions()));
-
- QClipboard* clipboard = QApplication::clipboard();
- connect(clipboard, SIGNAL(dataChanged()),
- this, SLOT(updatePasteAction()));
+ connect(&DolphinNewFileMenuObserver::instance(), &DolphinNewFileMenuObserver::errorMessage, this, &DolphinPart::slotErrorMessage);
+
+ connect(m_view, &DolphinView::directoryLoadingCompleted, this, &KParts::ReadOnlyPart::completed);
+ connect(m_view, &DolphinView::directoryLoadingCompleted, this, &DolphinPart::updatePasteAction);
+ connect(m_view, &DolphinView::directoryLoadingProgress, this, &DolphinPart::updateProgress);
+ connect(m_view, &DolphinView::errorMessage, this, &DolphinPart::slotErrorMessage);
+
+ setXMLFile(QStringLiteral("dolphinpart.rc"));
+
+ connect(m_view, &DolphinView::infoMessage, this, &DolphinPart::slotMessage);
+ connect(m_view, &DolphinView::operationCompletedMessage, this, &DolphinPart::slotMessage);
+ connect(m_view, &DolphinView::errorMessage, this, &DolphinPart::slotErrorMessage);
+ connect(m_view, &DolphinView::itemActivated, this, &DolphinPart::slotItemActivated);
+ connect(m_view, &DolphinView::itemsActivated, this, &DolphinPart::slotItemsActivated);
+ connect(m_view, &DolphinView::statusBarTextChanged, this, [this](const QString &text) {
+ const QString escapedText = Qt::convertFromPlainText(text);
+ Q_EMIT ReadOnlyPart::setStatusBarText(QStringLiteral("<qt>%1</qt>").arg(escapedText));
+ });
+ connect(m_view, &DolphinView::tabRequested, this, &DolphinPart::createNewWindow);
+ connect(m_view, &DolphinView::requestContextMenu, this, &DolphinPart::slotOpenContextMenu);
+ connect(m_view, &DolphinView::selectionChanged, m_extension, &KParts::NavigationExtension::selectionInfo);
+ connect(m_view, &DolphinView::selectionChanged, this, &DolphinPart::slotSelectionChanged);
+ connect(m_view, &DolphinView::requestItemInfo, this, &DolphinPart::slotRequestItemInfo);
+ connect(m_view, &DolphinView::modeChanged, this, &DolphinPart::viewModeChanged); // relay signal
+ connect(m_view, &DolphinView::redirection, this, &DolphinPart::slotDirectoryRedirection);
+
+ // Watch for changes that should result in updates to the
+ // status bar text.
+ connect(m_view, &DolphinView::itemCountChanged, this, &DolphinPart::updateStatusBar);
+ connect(m_view, &DolphinView::selectionChanged, this, &DolphinPart::updateStatusBar);
+
+ m_actionHandler = new DolphinViewActionHandler(actionCollection(), nullptr, this);
+ m_actionHandler->setCurrentView(m_view);
+ connect(m_actionHandler, &DolphinViewActionHandler::createDirectoryTriggered, this, &DolphinPart::createDirectory);
+
+ m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
+ connect(this, &DolphinPart::aboutToOpenURL, m_remoteEncoding, &DolphinRemoteEncoding::slotAboutToOpenUrl);
+
+ QClipboard *clipboard = QApplication::clipboard();
+ connect(clipboard, &QClipboard::dataChanged, this, &DolphinPart::updatePasteAction);
+
+ // Create file info and listing filter extensions.
+ // NOTE: Listing filter needs to be instantiated after the creation of the view.
+ new DolphinPartFileInfoExtension(this);
+
+ new DolphinPartListingFilterExtension(this);
+
+ KDirLister *lister = m_view->m_model->m_dirLister;
+ if (lister) {
+ DolphinPartListingNotificationExtension *notifyExt = new DolphinPartListingNotificationExtension(this);
+ connect(lister, &KDirLister::newItems, notifyExt, &DolphinPartListingNotificationExtension::slotNewItems);
+ connect(lister, &KDirLister::itemsDeleted, notifyExt, &DolphinPartListingNotificationExtension::slotItemsDeleted);
+ } else {
+ qCWarning(DolphinDebug) << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
+ }