diff options
| author | Nicolas Fella <[email protected]> | 2023-11-07 15:45:01 +0100 |
|---|---|---|
| committer | Nicolas Fella <[email protected]> | 2023-11-08 13:36:51 +0000 |
| commit | 2cd3d58eec5695899c26ca66a631fb79867b6584 (patch) | |
| tree | 8ea47aeaea6eda7aee91885fe545cd930cd070a9 /src/dolphinmainwindow.cpp | |
| parent | 8297e0a8c97c6e1f6d46b9ecc9c5f495f294d5b8 (diff) | |
Port away from KMoreTools
The idea behind KMoreTools was to point the user at external tools for a given job.
It provides a rather complex framework for that, including suggesting not-yet-installed tools.
The UX behind that isn't great though, which somewhat deep menu hierarchies and a somewhat arbitrary list of tools.
Most KDE apps have moved away from it, with only Dolphin remaining.
Instead provide direct integration with relevant KDE tools (Filelight, KDiskFree, KFind)
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 0d31df2da..635121062 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -48,7 +48,6 @@ #include <KJobWidgets> #include <KLocalizedString> #include <KMessageBox> -#include <KMoreToolsMenuFactory> #include <KProtocolInfo> #include <KProtocolManager> #include <KShell> @@ -1127,15 +1126,20 @@ void DolphinMainWindow::toggleShowMenuBar() QPointer<QAction> DolphinMainWindow::preferredSearchTool() { m_searchTools.clear(); - KMoreToolsMenuFactory("dolphin/search-tools").fillMenuFromGroupingNames(&m_searchTools, {"files-find"}, m_activeViewContainer->url()); - QList<QAction *> actions = m_searchTools.actions(); - if (actions.isEmpty()) { - return nullptr; - } - QAction *action = actions.first(); - if (action->isSeparator()) { + + KService::Ptr kfind = KService::serviceByDesktopName(QStringLiteral("org.kde.kfind")); + + if (!kfind) { return nullptr; } + + auto *action = new QAction(QIcon::fromTheme(kfind->icon()), kfind->name(), this); + + connect(action, &QAction::triggered, this, [kfind] { + auto *job = new KIO::ApplicationLauncherJob(kfind); + job->start(); + }); + return action; } |
