┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas Fella <[email protected]>2023-12-11 01:19:15 +0100
committerFelix Ernst <[email protected]>2024-05-30 15:21:39 +0000
commit0a8f84a52dcd246550b5ea0e795dd7b309f2ece1 (patch)
treeabbf7f002e4853328fdc7e78b8c86fe44a977026 /src
parent20628fd5c81a059b9fc3f447ca55f2603488ac72 (diff)
Offer installing Filelight if no disk usage analyzer was found
This avoids an empty menu and points the user towards a useful tool BUG: 477739
Diffstat (limited to 'src')
-rw-r--r--src/statusbar/statusbarspaceinfo.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/statusbar/statusbarspaceinfo.cpp b/src/statusbar/statusbarspaceinfo.cpp
index 253d912c0..9df416467 100644
--- a/src/statusbar/statusbarspaceinfo.cpp
+++ b/src/statusbar/statusbarspaceinfo.cpp
@@ -14,6 +14,7 @@
#include <KLocalizedString>
#include <KService>
+#include <QDesktopServices>
#include <QHBoxLayout>
#include <QMenu>
#include <QMouseEvent>
@@ -115,7 +116,17 @@ void StatusBarSpaceInfo::updateMenu()
const KService::Ptr kdiskfree = KService::serviceByDesktopName(QStringLiteral("org.kde.kdf"));
if (!filelight && !kdiskfree) {
- // nothing to show
+ 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
+ });
+
return;
}