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
43025364
Commit
43025364
authored
Oct 01, 2020
by
David Redondo
🏎
Browse files
Add sensor id conversion for cpu
parent
5d5dd393
Changes
2
Hide whitespace changes
Inline
Side-by-side
autotests/sensorfacecontrollertest.cpp
View file @
43025364
...
...
@@ -91,6 +91,7 @@ private Q_SLOTS:
{
newPrefix
+
QStringLiteral
(
"/used"
)},
};
}
QTest
::
addRow
(
"paritionsall"
)
<<
QJsonArray
{
QStringLiteral
(
"partitions/all/total"
),
...
...
@@ -103,7 +104,28 @@ private Q_SLOTS:
QStringLiteral
(
"disk/all/usedPercent"
),
QStringLiteral
(
"disk/all/used"
),
};
QTest
::
addRow
(
"cpu"
)
<<
QJsonArray
{
QStringLiteral
(
"cpu/cpu1/clock"
),
QStringLiteral
(
"cpu/cpu1/sys"
),
QStringLiteral
(
"cpu/cpu1/TotalLoad"
),
QStringLiteral
(
"cpu/system/sys"
),
QStringLiteral
(
"cpu/system/TotalLoad"
),
QStringLiteral
(
"cpu/system/user"
),
QStringLiteral
(
"cpu/system/wait"
),
}
<<
QJsonArray
{
QStringLiteral
(
"cpu/cpu1/frequency"
),
QStringLiteral
(
"cpu/cpu1/system"
),
QStringLiteral
(
"cpu/cpu1/usage"
),
QStringLiteral
(
"cpu/all/system"
),
QStringLiteral
(
"cpu/all/usage"
),
QStringLiteral
(
"cpu/all/user"
),
QStringLiteral
(
"cpu/all/wait"
),
};
}
void
testSensorIdConversion
()
{
QFETCH
(
QJsonArray
,
oldSensors
);
...
...
faces/SensorFaceController.cpp
View file @
43025364
...
...
@@ -163,6 +163,10 @@ SensorFaceControllerPrivate::SensorFaceControllerPrivate()
{
QRegularExpression
(
QStringLiteral
(
"(.*)/freespace$"
)),
QStringLiteral
(
"
\\
1/free"
)},
{
QRegularExpression
(
QStringLiteral
(
"(.*)/filllevel$"
)),
QStringLiteral
(
"
\\
1/usedPercent"
)},
{
QRegularExpression
(
QStringLiteral
(
"(.*)/usedspace$"
)),
QStringLiteral
(
"
\\
1/used"
)},
{
QRegularExpression
(
QStringLiteral
(
"cpu/system/(.*)$"
)),
QStringLiteral
(
"cpu/all/
\\
1"
)},
{
QRegularExpression
(
QStringLiteral
(
"cpu/(.*)/sys$"
)),
QStringLiteral
(
"cpu/
\\
1/system"
)},
{
QRegularExpression
(
QStringLiteral
(
"cpu/(.*)/TotalLoad$"
)),
QStringLiteral
(
"cpu/
\\
1/usage"
)},
{
QRegularExpression
(
QStringLiteral
(
"cpu/cpu(
\\
d+)/clock$"
)),
QStringLiteral
(
"cpu/cpu
\\
1/frequency"
)},
};
}
}
...
...
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