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
KSysGuard
Commits
85e3e7dd
Commit
85e3e7dd
authored
Oct 12, 2020
by
David Redondo
🏎
Browse files
Remove setShortNameFor
We do not anymore use a subsystem which was using this method.
parent
66321cea
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/global/ksgrd/ksgrdiface.cpp
View file @
85e3e7dd
...
...
@@ -139,7 +139,6 @@ void KSGRDIface::onSensorMetaDataRetrieved(int id, const QList<QByteArray> &answ
}
sensor
->
setName
(
sensorName
);
sensor
->
setShortName
(
shortNameFor
(
key
));
sensor
->
setMin
(
min
.
toDouble
());
sensor
->
setMax
(
max
.
toDouble
());
sensor
->
setUnit
(
unitFromString
(
unit
));
...
...
@@ -297,26 +296,6 @@ void KSGRDIface::answerReceived(int id, const QList<QByteArray> &answer)
onSensorUpdated
(
id
,
answer
);
}
QString
KSGRDIface
::
shortNameFor
(
const
QString
&
key
)
{
// TODO: This is pretty ugly, but it is really hard to add this information to ksysguardd.
// So for now, we just map sensor ids to short names and return that.
static
QHash
<
QString
,
QString
>
shortNames
=
{
{
QStringLiteral
(
"cpu/system/TotalLoad"
),
i18nc
(
"@title Total CPU Usage"
,
"Usage"
)
},
{
QStringLiteral
(
"mem/physical/used"
),
i18nc
(
"@title Total Memory Usage"
,
"Total Used"
)
},
{
QStringLiteral
(
"mem/physical/cached"
),
i18nc
(
"@title Cached Memory Usage"
,
"Cached"
)
},
{
QStringLiteral
(
"mem/physical/free"
),
i18nc
(
"@title Free Memory Amount"
,
"Free"
)
},
{
QStringLiteral
(
"mem/physical/available"
),
i18nc
(
"@title Available Memory Amount"
,
"Available"
)
},
{
QStringLiteral
(
"mem/physical/application"
),
i18nc
(
"@title Application Memory Usage"
,
"Application"
)
},
{
QStringLiteral
(
"mem/physical/buf"
),
i18nc
(
"@title Buffer Memory Usage"
,
"Buffer"
)
},
{
QStringLiteral
(
"cpu/system/processors"
),
i18nc
(
"@title Number of Processors"
,
"Processors"
)
},
{
QStringLiteral
(
"cpu/system/cores"
),
i18nc
(
"@title Number of Cores"
,
"Cores"
)
},
};
return
shortNames
.
value
(
key
,
QString
{});
}
K_PLUGIN_CLASS_WITH_JSON
(
KSGRDIface
,
"metadata.json"
)
#include
"ksgrdiface.moc"
plugins/global/ksgrd/ksgrdiface.h
View file @
85e3e7dd
...
...
@@ -60,7 +60,6 @@ private:
void
unsubscribe
(
const
QString
&
sensorPath
);
KSysGuard
::
Unit
unitFromString
(
const
QString
&
unitString
)
const
;
QString
shortNameFor
(
const
QString
&
key
);
//This qlist is just to have an index mapping because of KSGRD's old API
//Could be an index in SensorInfo subclass
...
...
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