From 6af29669c2c211b981481da237d3919463fe323d Mon Sep 17 00:00:00 2001 From: Andrey Butirsky Date: Thu, 14 Oct 2021 20:53:02 +0300 Subject: [PATCH] [freespacenotifier] impr: no notification for ro filesystems --- freespacenotifier/module.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/freespacenotifier/module.cpp b/freespacenotifier/module.cpp index c01583395..c3340cc6f 100644 --- a/freespacenotifier/module.cpp +++ b/freespacenotifier/module.cpp @@ -31,12 +31,18 @@ FreeSpaceNotifierModule::FreeSpaceNotifierModule(QObject *parent, const QListmountOptions().contains(QLatin1String("ro")) ) { + auto *homeNotifier = new FreeSpaceNotifier(homePath, ki18n("Your Home folder is running out of disk space, you have %1 MiB remaining (%2%)."), this); + connect(homeNotifier, &FreeSpaceNotifier::configureRequested, this, &FreeSpaceNotifierModule::showConfiguration); + } // If Home is on a separate partition from Root, warn for it, too. - auto homeMountPoint = KMountPoint::currentMountPoints().findByPath(homePath); - if (!homeMountPoint || homeMountPoint->mountPoint() != rootPath) { + if (KMountPoint::Ptr rootMountPoint; !homeMountPoint || + ( homeMountPoint->mountPoint() != rootPath && + ( !(rootMountPoint = KMountPoint::currentMountPoints().findByPath(rootPath)) || + !rootMountPoint->mountOptions().contains(QLatin1String("ro")) ) ) ) { auto *rootNotifier = new FreeSpaceNotifier(rootPath, ki18n("Your Root partition is running out of disk space, you have %1 MiB remaining (%2%)."), this); connect(rootNotifier, &FreeSpaceNotifier::configureRequested, this, &FreeSpaceNotifierModule::showConfiguration); }