X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8ffc72e87f4cffa8dce32da06e9a1d51a595765e..61ce7cea1d90ba1b83300e325d755789f67c8ca1:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index edf58f565..0c41b2bec 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,7 @@ #include #include #include -#include +#include #include #include @@ -533,23 +534,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() @@ -562,7 +547,10 @@ void DolphinPart::slotFindFile() if (!(actions.isEmpty())) { actions.first()->trigger(); } else { - KRun::run(QStringLiteral("kfind"), {url()}, widget()); + KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(QStringLiteral("kfind"), {url().toString()}, this); + job->setDesktopName(QStringLiteral("org.kde.kfind")); + job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, widget())); + job->start(); } }