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
28e2ce2e
Commit
28e2ce2e
authored
Feb 27, 2022
by
Laurent Montel
Browse files
Use std::as_const
parent
d4d8a5a2
Pipeline
#142931
passed with stage
in 1 minute and 13 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
faces/SensorFaceController.cpp
View file @
28e2ce2e
...
...
@@ -220,7 +220,7 @@ QJsonArray SensorFaceControllerPrivate::readSensors(const KConfigGroup &read, co
QJsonArray
newSensors
;
for
(
auto
entry
:
original
)
{
QString
sensorId
=
entry
.
toString
();
for
(
auto
replacement
:
qAsC
onst
(
sensorIdReplacements
))
{
for
(
auto
replacement
:
std
::
as_c
onst
(
sensorIdReplacements
))
{
auto
match
=
replacement
.
first
.
match
(
sensorId
);
if
(
match
.
hasMatch
())
{
sensorId
.
replace
(
replacement
.
first
,
replacement
.
second
);
...
...
processcore/cgroup_data_model.cpp
View file @
28e2ce2e
...
...
@@ -104,7 +104,7 @@ CGroupDataModel::CGroupDataModel(const QString &root, QObject *parent)
attributes
.
append
(
new
GroupNameAttribute
(
this
));
attributes
.
append
(
new
AppNameAttribute
(
this
));
attributes
.
append
(
new
AppIconAttribute
(
this
));
for
(
auto
attr
:
qAsC
onst
(
attributes
))
{
for
(
auto
attr
:
std
::
as_c
onst
(
attributes
))
{
d
->
m_availableAttributes
[
attr
->
id
()]
=
attr
;
}
...
...
@@ -175,7 +175,7 @@ QStringList CGroupDataModel::enabledAttributes() const
{
QStringList
rc
;
rc
.
reserve
(
d
->
m_enabledAttributes
.
size
());
for
(
auto
attr
:
qAsC
onst
(
d
->
m_enabledAttributes
))
{
for
(
auto
attr
:
std
::
as_c
onst
(
d
->
m_enabledAttributes
))
{
rc
<<
attr
->
id
();
}
return
rc
;
...
...
@@ -210,7 +210,7 @@ void CGroupDataModel::setEnabledAttributes(const QStringList &enabledAttributes)
});
}
for
(
auto
unusedAttr
:
qAsC
onst
(
unusedAttributes
))
{
for
(
auto
unusedAttr
:
std
::
as_c
onst
(
unusedAttributes
))
{
disconnect
(
unusedAttr
,
&
KSysGuard
::
ProcessAttribute
::
dataChanged
,
this
,
nullptr
);
}
...
...
@@ -405,7 +405,7 @@ void CGroupDataModel::update()
d
->
m_oldGroups
=
d
->
m_cgroupMap
;
Processes
::
UpdateFlags
flags
;
for
(
auto
attribute
:
qAsC
onst
(
d
->
m_enabledAttributes
))
{
for
(
auto
attribute
:
std
::
as_c
onst
(
d
->
m_enabledAttributes
))
{
flags
|=
attribute
->
requiredUpdateFlags
();
}
...
...
@@ -415,7 +415,7 @@ void CGroupDataModel::update()
update
(
d
->
m_rootGroup
.
data
());
for
(
auto
c
:
qAsC
onst
(
d
->
m_oldGroups
))
{
for
(
auto
c
:
std
::
as_c
onst
(
d
->
m_oldGroups
))
{
int
row
=
d
->
m_cGroups
.
indexOf
(
c
);
if
(
row
>=
0
)
{
beginRemoveRows
(
QModelIndex
(),
row
,
row
);
...
...
processcore/extended_process_list.cpp
View file @
28e2ce2e
...
...
@@ -523,7 +523,7 @@ ExtendedProcesses::ExtendedProcesses(QObject *parent)
});
connect
(
this
,
&
KSysGuard
::
Processes
::
updated
,
this
,
[
this
]()
{
for
(
auto
p
:
qAsC
onst
(
d
->
m_providers
))
{
for
(
auto
p
:
std
::
as_c
onst
(
d
->
m_providers
))
{
if
(
p
->
enabled
())
{
p
->
update
();
}
...
...
@@ -543,7 +543,7 @@ QVector<ProcessAttribute *> ExtendedProcesses::attributes() const
QVector
<
ProcessAttribute
*>
ExtendedProcesses
::
extendedAttributes
()
const
{
QVector
<
ProcessAttribute
*>
rc
;
for
(
auto
p
:
qAsC
onst
(
d
->
m_providers
))
{
for
(
auto
p
:
std
::
as_c
onst
(
d
->
m_providers
))
{
rc
<<
p
->
attributes
();
}
return
rc
;
...
...
processcore/process_data_model.cpp
View file @
28e2ce2e
...
...
@@ -217,7 +217,7 @@ void ProcessDataModel::setEnabledAttributes(const QStringList &enabledAttributes
});
}
for
(
auto
*
unusedAttribute
:
qAsC
onst
(
unusedAttributes
))
{
for
(
auto
*
unusedAttribute
:
std
::
as_c
onst
(
unusedAttributes
))
{
disconnect
(
unusedAttribute
,
&
KSysGuard
::
ProcessAttribute
::
dataChanged
,
this
,
nullptr
);
}
...
...
@@ -367,7 +367,7 @@ void ProcessDataModel::Private::endMoveProcess()
void
ProcessDataModel
::
Private
::
update
()
{
Processes
::
UpdateFlags
flags
;
for
(
auto
attribute
:
qAsC
onst
(
m_enabledAttributes
))
{
for
(
auto
attribute
:
std
::
as_c
onst
(
m_enabledAttributes
))
{
flags
|=
attribute
->
requiredUpdateFlags
();
}
...
...
sensors/SensorTreeModel.cpp
View file @
28e2ce2e
...
...
@@ -31,7 +31,7 @@ struct Q_DECL_HIDDEN SensorTreeItem {
inline
int
indexOf
(
const
QString
&
segment
)
{
int
index
=
0
;
for
(
auto
child
:
qAsC
onst
(
children
))
{
for
(
auto
child
:
std
::
as_c
onst
(
children
))
{
if
(
child
->
segment
==
segment
)
{
return
index
;
}
...
...
@@ -44,7 +44,7 @@ struct Q_DECL_HIDDEN SensorTreeItem {
inline
SensorTreeItem
*
itemAt
(
int
index
)
{
int
currentIndex
=
0
;
for
(
auto
child
:
qAsC
onst
(
children
))
{
for
(
auto
child
:
std
::
as_c
onst
(
children
))
{
if
(
currentIndex
++
==
index
)
{
return
child
;
}
...
...
systemstats/AggregateSensor.cpp
View file @
28e2ce2e
...
...
@@ -126,7 +126,7 @@ void AggregateSensor::subscribe()
bool
wasSubscribed
=
SensorProperty
::
isSubscribed
();
SensorProperty
::
subscribe
();
if
(
!
wasSubscribed
&&
isSubscribed
())
{
for
(
auto
sensor
:
qAsC
onst
(
d
->
sensors
))
{
for
(
auto
sensor
:
std
::
as_c
onst
(
d
->
sensors
))
{
if
(
sensor
)
{
sensor
->
subscribe
();
}
...
...
@@ -139,7 +139,7 @@ void AggregateSensor::unsubscribe()
bool
wasSubscribed
=
SensorProperty
::
isSubscribed
();
SensorProperty
::
unsubscribe
();
if
(
wasSubscribed
&&
!
isSubscribed
())
{
for
(
auto
sensor
:
qAsC
onst
(
d
->
sensors
))
{
for
(
auto
sensor
:
std
::
as_c
onst
(
d
->
sensors
))
{
if
(
sensor
)
{
sensor
->
unsubscribe
();
}
...
...
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