]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/terminal/terminalpanel.cpp
Add "Dimensions" (width x height) role
[dolphin.git] / src / panels / terminal / terminalpanel.cpp
index 714431c71e6c9bc75cb9aedd9d571e7174d96c44..9d30dcd62be640c4e6acbebf01f944ec2a3f7f5a 100644 (file)
@@ -5,7 +5,6 @@
  */
 
 #include "terminalpanel.h"
-#include "kiofuse_interface.h"
 
 #include <KIO/DesktopExecParser>
 #include <KIO/Job>
@@ -16,9 +15,7 @@
 #include <KMountPoint>
 #include <KParts/ReadOnlyPart>
 #include <KPluginFactory>
-#include <KPluginLoader>
 #include <KProtocolInfo>
-#include <KService>
 #include <KShell>
 #include <kde_terminal_interface.h>
 
@@ -69,7 +66,7 @@ QString TerminalPanel::currentWorkingDirectory()
 void TerminalPanel::terminalExited()
 {
     m_terminal = nullptr;
-    emit hideTerminalPanel();
+    Q_EMIT hideTerminalPanel();
 }
 
 bool TerminalPanel::isHiddenInVisibleWindow() const
@@ -131,11 +128,7 @@ void TerminalPanel::showEvent(QShowEvent* event)
 
     if (!m_terminal) {
         m_clearTerminal = true;
-        KPluginFactory* factory = nullptr;
-        KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("konsolepart"));
-        if (service) {
-            factory = KPluginLoader(service->library()).factory();
-        }
+        KPluginFactory *factory = KPluginFactory::loadFactory(KPluginMetaData(QStringLiteral("konsolepart"))).plugin;
         m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : nullptr;
         if (m_konsolePart) {
             connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited);
@@ -287,7 +280,7 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir)
     KMountPoint::Ptr mountPoint = KMountPoint::currentMountPoints().findByPath(m_konsolePartCurrentDirectory);
     if (mountPoint && mountPoint->mountType() != QStringLiteral("fuse.kio-fuse")) {
         // Not in KIOFUse mount, so just switch to the corresponding URL.
-        emit changeUrl(url);
+        Q_EMIT changeUrl(url);
         return;
     }
 
@@ -297,11 +290,11 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir)
         watcher->deleteLater();
         if (reply.isError()) {
             // KIOFuse errored out... just show the normal URL
-            emit changeUrl(url);
+            Q_EMIT changeUrl(url);
         } else {
             // Our location happens to be in a KIOFuse mount and is mounted.
             // Let's change the DolphinView to point to the remote URL equivalent.
-            emit changeUrl(QUrl::fromUserInput(reply.value()));
+            Q_EMIT changeUrl(QUrl::fromUserInput(reply.value()));
         }
     });
 }