mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-02 14:45:04 +00:00
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
This commit is contained in:
parent
20628fd5c8
commit
0a8f84a52d
|
@ -14,6 +14,7 @@
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KService>
|
#include <KService>
|
||||||
|
|
||||||
|
#include <QDesktopServices>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
@ -115,7 +116,17 @@ void StatusBarSpaceInfo::updateMenu()
|
||||||
const KService::Ptr kdiskfree = KService::serviceByDesktopName(QStringLiteral("org.kde.kdf"));
|
const KService::Ptr kdiskfree = KService::serviceByDesktopName(QStringLiteral("org.kde.kdf"));
|
||||||
|
|
||||||
if (!filelight && !kdiskfree) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue