X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/91a4d5da94a6b0b60ad7989a402f654710103e99..b889a446bfe851a7f49821d469c5f3041b6e5774:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 4ba1f0742..a7f0d85cd 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -46,6 +45,7 @@ #include #include +#include K_PLUGIN_CLASS_WITH_JSON(DolphinPart, "dolphinpart.json") @@ -140,8 +140,9 @@ DolphinPart::~DolphinPart() void DolphinPart::createActions() { // Edit menu - - m_newFileMenu = new DolphinNewFileMenu(actionCollection()->action(QStringLiteral("create_dir")), this); + QAction *newDirAction = actionCollection()->action(QStringLiteral("create_dir")); + QAction *newFileAction = actionCollection()->action(QStringLiteral("create_file")); + m_newFileMenu = new DolphinNewFileMenu(newDirAction, newFileAction, this); m_newFileMenu->setParentWidget(widget()); connect(m_newFileMenu->menu(), &QMenu::aboutToShow, this, &DolphinPart::updateNewMenu); @@ -467,7 +468,7 @@ void DolphinPart::openSelectionDialog(const QString &title, const QString &text, dialog->setTextValue(QStringLiteral("*")); - connect(dialog, &QDialog::accepted, this, [=]() { + connect(dialog, &QDialog::accepted, this, [=, this]() { const QString pattern = dialog->textValue(); if (!pattern.isEmpty()) { QStringList items = dialog->comboBoxItems(); @@ -527,17 +528,10 @@ void DolphinPart::slotOpenTerminal() void DolphinPart::slotFindFile() { - QMenu searchTools; - KMoreToolsMenuFactory("dolphin/search-tools").fillMenuFromGroupingNames(&searchTools, {"files-find"}, QUrl::fromLocalFile(localFilePathOrHome())); - QList actions = searchTools.actions(); - if (!(actions.isEmpty())) { - actions.first()->trigger(); - } else { - 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(); - } + 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(); } void DolphinPart::updateNewMenu()