]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use KParts::ReadOnlyPart::localFilePath() in DolphinPart::slotOpenTerminal()
authorPiotr Henryk Dabrowski <phd@phd.re>
Sat, 21 Dec 2019 19:27:41 +0000 (12:27 -0700)
committerNate Graham <nate@kde.org>
Sat, 21 Dec 2019 19:28:06 +0000 (12:28 -0700)
Reviewers: ngraham, elvisangelaccio, #dolphin

Reviewed By: ngraham, elvisangelaccio, #dolphin

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D26140

src/dolphinpart.cpp

index edf58f565095e73896c60ca3abb551be02a12dea..7e7425121ca81105c7016630a2b6d9289550d5d6 100644 (file)
@@ -533,23 +533,7 @@ void DolphinPart::setNameFilter(const QString& nameFilter)
 
 void DolphinPart::slotOpenTerminal()
 {
-    QString dir(QDir::homePath());
-
-    QUrl u(url());
-
-    // If the given directory is not local, it can still be the URL of an
-    // ioslave using UDS_LOCAL_PATH which to be converted first.
-    KIO::StatJob* statJob = KIO::mostLocalUrl(u);
-    KJobWidgets::setWindow(statJob, widget());
-    statJob->exec();
-    u = statJob->mostLocalUrl();
-
-    //If the URL is local after the above conversion, set the directory.
-    if (u.isLocalFile()) {
-        dir = u.toLocalFile();
-    }
-
-    KToolInvocation::invokeTerminal(QString(), dir);
+    KToolInvocation::invokeTerminal(QString(), KParts::ReadOnlyPart::localFilePath());
 }
 
 void DolphinPart::slotFindFile()