Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
libksysguard
Commits
5bd6a1d7
Commit
5bd6a1d7
authored
Jan 14, 2021
by
David Edmundson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid unnecessary config loading
SensorFace defaults don't need cascading and globals
parent
b347fcc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
faces/SensorFaceController.cpp
faces/SensorFaceController.cpp
+4
-4
No files found.
faces/SensorFaceController.cpp
View file @
5bd6a1d7
...
...
@@ -110,7 +110,7 @@ void PresetsModel::reload()
// TODO config
QVariantMap
config
;
KConfigGroup
configGroup
(
KSharedConfig
::
openConfig
(
p
.
filePath
(
"config"
,
QStringLiteral
(
"faceproperties"
))),
QStringLiteral
(
"Config"
));
KConfigGroup
configGroup
(
KSharedConfig
::
openConfig
(
p
.
filePath
(
"config"
,
QStringLiteral
(
"faceproperties"
))
,
KConfig
::
SimpleConfig
),
QStringLiteral
(
"Config"
));
const
QStringList
keys
=
configGroup
.
keyList
();
for
(
const
QString
&
key
:
keys
)
{
...
...
@@ -568,7 +568,7 @@ void SensorFaceController::setFaceId(const QString &face)
d
->
contextObj
->
setTranslationDomain
(
QLatin1String
(
"ksysguard_face_"
)
+
face
);
d
->
faceProperties
=
KConfigGroup
(
KSharedConfig
::
openConfig
(
d
->
facePackage
.
filePath
(
"FaceProperties"
)),
QStringLiteral
(
"Config"
));
d
->
faceProperties
=
KConfigGroup
(
KSharedConfig
::
openConfig
(
d
->
facePackage
.
filePath
(
"FaceProperties"
)
,
KConfig
::
SimpleConfig
),
QStringLiteral
(
"Config"
));
const
QString
xmlPath
=
d
->
facePackage
.
filePath
(
"mainconfigxml"
);
...
...
@@ -737,7 +737,7 @@ void SensorFaceController::loadPreset(const QString &preset)
KDesktopFile
df
(
presetPackage
.
path
()
+
QStringLiteral
(
"metadata.desktop"
));
auto
c
=
KSharedConfig
::
openConfig
(
presetPackage
.
filePath
(
"config"
,
QStringLiteral
(
"faceproperties"
)));
auto
c
=
KSharedConfig
::
openConfig
(
presetPackage
.
filePath
(
"config"
,
QStringLiteral
(
"faceproperties"
))
,
KConfig
::
SimpleConfig
);
const
KConfigGroup
presetGroup
(
c
,
QStringLiteral
(
"Config"
));
const
KConfigGroup
colorsGroup
(
c
,
QStringLiteral
(
"SensorColors"
));
...
...
@@ -760,7 +760,7 @@ void SensorFaceController::loadPreset(const QString &preset)
emit
sensorColorsChanged
();
if
(
d
->
faceConfigLoader
)
{
KConfigGroup
presetGroup
(
KSharedConfig
::
openConfig
(
presetPackage
.
filePath
(
"FaceProperties"
)),
QStringLiteral
(
"FaceConfig"
));
KConfigGroup
presetGroup
(
KSharedConfig
::
openConfig
(
presetPackage
.
filePath
(
"FaceProperties"
)
,
KConfig
::
SimpleConfig
),
QStringLiteral
(
"FaceConfig"
));
for
(
const
QString
&
key
:
presetGroup
.
keyList
())
{
KConfigSkeletonItem
*
item
=
d
->
faceConfigLoader
->
findItemByName
(
key
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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