Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
707b22ff
Commit
707b22ff
authored
Oct 14, 2021
by
Andrey Butirsky
Browse files
[freespacenotifier] impr: no notification for ro filesystems
(cherry picked from commit
6af29669
)
parent
e3a20f4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
freespacenotifier/module.cpp
View file @
707b22ff
...
...
@@ -31,12 +31,18 @@ FreeSpaceNotifierModule::FreeSpaceNotifierModule(QObject *parent, const QList<QV
const
QString
rootPath
=
QStringLiteral
(
"/"
);
const
QString
homePath
=
QDir
::
homePath
();
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
);
const
auto
homeMountPoint
=
KMountPoint
::
currentMountPoints
().
findByPath
(
homePath
);
if
(
!
homeMountPoint
||
!
homeMountPoint
->
mountOptions
().
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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment