This avoids an empty menu and points the user towards a useful tool
BUG: 477739
#include <KLocalizedString>
#include <KService>
#include <KLocalizedString>
#include <KService>
+#include <QDesktopServices>
#include <QHBoxLayout>
#include <QMenu>
#include <QMouseEvent>
#include <QHBoxLayout>
#include <QMenu>
#include <QMouseEvent>
const KService::Ptr kdiskfree = KService::serviceByDesktopName(QStringLiteral("org.kde.kdf"));
if (!filelight && !kdiskfree) {
const KService::Ptr kdiskfree = KService::serviceByDesktopName(QStringLiteral("org.kde.kdf"));
if (!filelight && !kdiskfree) {
+ QAction *installFilelight =
+ m_buttonMenu->addAction(QIcon::fromTheme(QStringLiteral("filelight")), i18n("Install Filelight to View Disk Usage Statistics…"));
+
+ connect(installFilelight, &QAction::triggered, this, [] {
+#ifdef Q_OS_WIN
+ QDesktopServices::openUrl(QUrl("https://apps.kde.org/filelight"));
+#else
+ QDesktopServices::openUrl(QUrl("appstream://org.kde.filelight.desktop"));
+#endif
+ });
+