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
libksysguard
Commits
320686e2
Commit
320686e2
authored
Sep 25, 2020
by
David Redondo
🏎
Browse files
Add disk sensors to group regexes
parent
acf19e36
Changes
1
Hide whitespace changes
Inline
Side-by-side
sensors/SensorGroup.cpp
View file @
320686e2
...
...
@@ -61,8 +61,17 @@ void SensorGroup::retranslate()
m_sensorNames
[
QStringLiteral
(
"network/(?!all).*/upload"
)]
=
i18n
(
"[Group] Upload Rate"
);
m_sensorNames
[
QStringLiteral
(
"network/(?!all).*/totalUpload"
)]
=
i18n
(
"[Group] Total Uploaded"
);
m_sensorNames
[
QStringLiteral
(
"disk/(?!all).*/name"
)]
=
i18n
(
"[Group] Name"
);
m_sensorNames
[
QStringLiteral
(
"disk/(?!all).*/total"
)]
=
i18n
(
"[Group] Total Space"
);
m_sensorNames
[
QStringLiteral
(
"disk/(?!all).*/used"
)]
=
i18n
(
"[Group] Used Space"
);
m_sensorNames
[
QStringLiteral
(
"disk/(?!all).*/free"
)]
=
i18n
(
"[Group] Free Space"
);
m_sensorNames
[
QStringLiteral
(
"disk/(?!all).*/read"
)]
=
i18n
(
"[Group] Read Rate"
);
m_sensorNames
[
QStringLiteral
(
"disk/(?!all).*/write"
)]
=
i18n
(
"[Group] Write Rate"
);
m_sensorNames
[
QStringLiteral
(
"disk/(?!all).*/usedPercent"
)]
=
i18n
(
"[Group] Percentage Used"
);
m_sensorNames
[
QStringLiteral
(
"disk/(?!all).*/freePercent"
)]
=
i18n
(
"[Group] Percentage Free"
);
m_segmentNames
[
QLatin1String
(
"cpu
\\
d+"
)]
=
i18n
(
"[Group] CPU"
);
m_segmentNames
[
QLatin1String
(
"disk
\\
d+
"
)]
=
i18n
(
"[Group] Disk"
);
m_segmentNames
[
QLatin1String
(
"disk
/(?!all).*
"
)]
=
i18n
(
"[Group] Disk"
);
m_segmentNames
[
QLatin1String
(
"(?!all).*"
)]
=
i18n
(
"[Group]"
);
}
...
...
@@ -72,6 +81,7 @@ QString SensorGroup::groupRegexForId(const QString &key)
QRegularExpression
cpuExpr
(
QStringLiteral
(
"cpu/cpu
\\
d+/(.*)"
));
QRegularExpression
netExpr
(
QStringLiteral
(
"network/(?!all).*/(.*)$"
));
QRegularExpression
partitionsExpr
(
QStringLiteral
(
"partitions/(?!all).*/(.*)$"
));
QRegularExpression
diskExpr
(
QStringLiteral
(
"disk/(?!all).*/(.*)"
));
if
(
key
.
contains
(
cpuExpr
))
{
QString
expr
=
key
;
...
...
@@ -84,6 +94,10 @@ QString SensorGroup::groupRegexForId(const QString &key)
}
else
if
(
key
.
contains
(
partitionsExpr
))
{
QString
expr
=
key
;
return
expr
.
replace
(
partitionsExpr
,
QStringLiteral
(
"partitions/(?!all).*/
\\
1"
));
}
else
if
(
key
.
contains
(
diskExpr
))
{
QString
expr
=
key
;
return
expr
.
replace
(
diskExpr
,
QStringLiteral
(
"disk/(?!all).*/
\\
1"
));
}
return
QString
();
...
...
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