From 2cd3d58eec5695899c26ca66a631fb79867b6584 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Tue, 7 Nov 2023 15:45:01 +0100 Subject: 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) --- src/dolphinmainwindow.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/dolphinmainwindow.cpp') 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 #include #include -#include #include #include #include @@ -1127,15 +1126,20 @@ void DolphinMainWindow::toggleShowMenuBar() QPointer DolphinMainWindow::preferredSearchTool() { m_searchTools.clear(); - KMoreToolsMenuFactory("dolphin/search-tools").fillMenuFromGroupingNames(&m_searchTools, {"files-find"}, m_activeViewContainer->url()); - QList 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; } -- cgit v1.3