diff options
| author | Nicolas Fella <[email protected]> | 2023-12-11 01:19:15 +0100 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2024-05-30 15:21:39 +0000 |
| commit | 0a8f84a52dcd246550b5ea0e795dd7b309f2ece1 (patch) | |
| tree | abbf7f002e4853328fdc7e78b8c86fe44a977026 /src/statusbar/statusbarspaceinfo.cpp | |
| parent | 20628fd5c81a059b9fc3f447ca55f2603488ac72 (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/statusbar/statusbarspaceinfo.cpp')
| -rw-r--r-- | src/statusbar/statusbarspaceinfo.cpp | 13 |
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; } |
