X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/e0085fb2804eedfe91b05c1c0c272758466fb62f..b65576a131eb59eaab4d33af830bdb2d2f9fde9f:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index dc083f1a5..12c361011 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 @@ -53,6 +54,7 @@ #include #include #include +#include #include #include @@ -506,7 +508,7 @@ void DolphinPart::openSelectionDialog(const QString& title, const QString& text, const QString pattern = QInputDialog::getText(m_view, title, text, QLineEdit::Normal, QStringLiteral("*"), &okClicked); if (okClicked && !pattern.isEmpty()) { - QRegExp patternRegExp(pattern, Qt::CaseSensitive, QRegExp::Wildcard); + const QRegularExpression patternRegExp(QRegularExpression::wildcardToRegularExpression(pattern)); m_view->selectItems(patternRegExp, selectItems); } } @@ -533,23 +535,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 +548,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(); } } @@ -572,7 +561,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() @@ -589,7 +578,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(); }