X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/43ea7052e15b1cb917bcc6cd2bd3a8046179e45c..37df39b93bf23b89ca760d4dd793788833d9a3e1:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 607917f9a..7e7425121 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -532,28 +533,21 @@ 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() { - KRun::run(QStringLiteral("kfind"), {url()}, widget()); + QMenu searchTools; + KMoreToolsMenuFactory("dolphin/search-tools").fillMenuFromGroupingNames( + &searchTools, { "files-find" }, QUrl::fromLocalFile(KParts::ReadOnlyPart::localFilePath()) + ); + QList actions = searchTools.actions(); + if (!(actions.isEmpty())) { + actions.first()->trigger(); + } else { + KRun::run(QStringLiteral("kfind"), {url()}, widget()); + } } void DolphinPart::updateNewMenu() @@ -562,7 +556,7 @@ void DolphinPart::updateNewMenu() m_newFileMenu->checkUpToDate(); m_newFileMenu->setViewShowsHiddenFiles(m_view->hiddenFilesShown()); // And set the files that the menu apply on : - m_newFileMenu->setPopupFiles(url()); + m_newFileMenu->setPopupFiles(QList() << url()); } void DolphinPart::updateStatusBar() @@ -579,7 +573,7 @@ void DolphinPart::updateProgress(int percent) void DolphinPart::createDirectory() { m_newFileMenu->setViewShowsHiddenFiles(m_view->hiddenFilesShown()); - m_newFileMenu->setPopupFiles(url()); + m_newFileMenu->setPopupFiles(QList() << url()); m_newFileMenu->createDirectory(); }