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
Plasma applet for NetworkManager
Commits
2d26a219
Commit
2d26a219
authored
Feb 21, 2022
by
Laurent Montel
Browse files
Use std::as_const
parent
708a39db
Pipeline
#140444
passed with stage
in 1 minute and 26 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
libs/editor/connectioneditorbase.cpp
View file @
2d26a219
...
...
@@ -303,7 +303,7 @@ void ConnectionEditorBase::initialize()
// Re-check validation
bool
valid
=
true
;
for
(
SettingWidget
*
widget
:
qAsC
onst
(
m_settingWidgets
))
{
for
(
SettingWidget
*
widget
:
std
::
as_c
onst
(
m_settingWidgets
))
{
valid
=
valid
&&
widget
->
isValid
();
connect
(
widget
,
&
SettingWidget
::
validChanged
,
this
,
&
ConnectionEditorBase
::
validChanged
);
}
...
...
@@ -421,7 +421,7 @@ void ConnectionEditorBase::initialize()
}
}
}
else
{
for
(
const
QString
&
secret
:
qAsC
onst
(
requiredSecrets
))
{
for
(
const
QString
&
secret
:
std
::
as_c
onst
(
requiredSecrets
))
{
if
(
setting
.
contains
(
secret
+
QLatin1String
(
"-flags"
)))
{
NetworkManager
::
Setting
::
SecretFlagType
secretFlag
=
(
NetworkManager
::
Setting
::
SecretFlagType
)
setting
.
value
(
secret
+
QLatin1String
(
"-flags"
)).
toInt
();
...
...
@@ -466,7 +466,7 @@ void ConnectionEditorBase::replyFinished(QDBusPendingCallWatcher *watcher)
NetworkManager
::
Setting
::
Ptr
setting
=
m_connection
->
setting
(
NetworkManager
::
Setting
::
typeFromString
(
key
));
if
(
setting
)
{
setting
->
secretsFromMap
(
secrets
.
value
(
key
));
for
(
SettingWidget
*
widget
:
qAsC
onst
(
m_settingWidgets
))
{
for
(
SettingWidget
*
widget
:
std
::
as_c
onst
(
m_settingWidgets
))
{
const
QString
type
=
widget
->
type
();
if
(
type
==
settingName
||
(
settingName
==
NetworkManager
::
Setting
::
typeAsString
(
NetworkManager
::
Setting
::
Security8021x
)
...
...
@@ -501,7 +501,7 @@ void ConnectionEditorBase::validChanged(bool valid)
Q_EMIT
validityChanged
(
false
);
return
;
}
else
{
for
(
SettingWidget
*
widget
:
qAsC
onst
(
m_settingWidgets
))
{
for
(
SettingWidget
*
widget
:
std
::
as_c
onst
(
m_settingWidgets
))
{
if
(
!
widget
->
isValid
())
{
m_valid
=
false
;
Q_EMIT
validityChanged
(
false
);
...
...
libs/editor/widgets/ssidcombobox.cpp
View file @
2d26a219
...
...
@@ -113,7 +113,7 @@ void SsidComboBox::addSsidsToCombo(const QList<NetworkManager::WirelessNetwork::
continue
;
}
for
(
const
NetworkManager
::
WirelessDevice
::
Ptr
&
wifiDev
:
qAsC
onst
(
wifiDevices
))
{
for
(
const
NetworkManager
::
WirelessDevice
::
Ptr
&
wifiDev
:
std
::
as_c
onst
(
wifiDevices
))
{
if
(
wifiDev
->
findNetwork
(
network
->
ssid
())
==
network
)
{
if
(
!
empty
)
{
insertSeparator
(
count
());
...
...
libs/models/creatableconnectionsmodel.cpp
View file @
2d26a219
...
...
@@ -234,7 +234,7 @@ void CreatableConnectionsModel::populateModel()
return
QString
::
localeAwareCompare
(
left
.
name
(),
right
.
name
())
<=
0
;
});
for
(
const
auto
&
service
:
qAsC
onst
(
plugins
))
{
for
(
const
auto
&
service
:
std
::
as_c
onst
(
plugins
))
{
const
QString
vpnType
=
service
.
value
(
QStringLiteral
(
"X-NetworkManager-Services"
));
const
QString
vpnSubType
=
service
.
value
(
QStringLiteral
(
"X-NetworkManager-Services-Subtype"
));
const
QString
vpnDescription
=
service
.
description
();
...
...
vpn/l2tp/l2tpwidget.cpp
View file @
2d26a219
...
...
@@ -33,7 +33,7 @@ L2tpWidget::L2tpWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *
// around the filesystem, also if it is a .p12 file, set the other URLs to that .p12 file.
QList
<
const
KUrlRequester
*>
requesters
;
requesters
<<
m_ui
->
userCA
<<
m_ui
->
userCert
<<
m_ui
->
userKey
;
for
(
const
KUrlRequester
*
requester
:
qAsC
onst
(
requesters
))
{
for
(
const
KUrlRequester
*
requester
:
std
::
as_c
onst
(
requesters
))
{
connect
(
requester
,
&
KUrlRequester
::
urlSelected
,
this
,
&
L2tpWidget
::
updateStartDirUrl
);
}
...
...
@@ -228,7 +228,7 @@ void L2tpWidget::updateStartDirUrl(const QUrl &url)
requesters
<<
m_ui
->
userCA
<<
m_ui
->
userCert
<<
m_ui
->
userKey
;
bool
isP12
=
url
.
toString
().
endsWith
(
QLatin1String
(
".p12"
));
for
(
KUrlRequester
*
requester
:
qAsC
onst
(
requesters
))
{
for
(
KUrlRequester
*
requester
:
std
::
as_c
onst
(
requesters
))
{
requester
->
setStartDir
(
url
.
adjusted
(
QUrl
::
RemoveFilename
|
QUrl
::
StripTrailingSlash
));
if
(
isP12
)
{
requester
->
setUrl
(
url
);
...
...
vpn/openvpn/openvpn.cpp
View file @
2d26a219
...
...
@@ -642,7 +642,7 @@ NMVariantMapMap OpenVpnUiPlugin::importConnectionSettings(const QString &fileNam
list
<<
ipRoute
;
}
QList
<
QList
<
uint
>>
dbusRoutes
;
for
(
const
NetworkManager
::
IpRoute
&
route
:
qAsC
onst
(
list
))
{
for
(
const
NetworkManager
::
IpRoute
&
route
:
std
::
as_c
onst
(
list
))
{
QList
<
uint
>
dbusRoute
;
dbusRoute
<<
htonl
(
route
.
ip
().
toIPv4Address
())
<<
route
.
prefixLength
()
<<
htonl
(
route
.
nextHop
().
toIPv4Address
())
<<
route
.
metric
();
dbusRoutes
<<
dbusRoute
;
...
...
vpn/openvpn/openvpnauth.cpp
View file @
2d26a219
...
...
@@ -59,7 +59,7 @@ void OpenVpnAuthWidget::readSecrets()
if
(
!
m_hints
.
isEmpty
())
{
QString
passwordType
;
QString
prompt
;
for
(
const
QString
&
hint
:
qAsC
onst
(
m_hints
))
{
for
(
const
QString
&
hint
:
std
::
as_c
onst
(
m_hints
))
{
const
QString
vpnMessage
=
QStringLiteral
(
"x-vpn-message:"
);
if
(
hint
.
startsWith
(
vpnMessage
))
{
prompt
=
hint
.
right
(
hint
.
length
()
-
vpnMessage
.
length
());
...
...
vpn/openvpn/openvpnwidget.cpp
View file @
2d26a219
...
...
@@ -275,7 +275,7 @@ void OpenVpnSettingWidget::updateStartDir(const QUrl &url)
QList
<
KUrlRequester
*>
requesters
;
requesters
<<
d
->
ui
.
x509CaFile
<<
d
->
ui
.
x509Cert
<<
d
->
ui
.
x509Key
<<
d
->
ui
.
pskSharedKey
<<
d
->
ui
.
passCaFile
<<
d
->
ui
.
x509PassCaFile
<<
d
->
ui
.
x509PassCert
<<
d
->
ui
.
x509PassKey
;
for
(
KUrlRequester
*
requester
:
qAsC
onst
(
requesters
))
{
for
(
KUrlRequester
*
requester
:
std
::
as_c
onst
(
requesters
))
{
requester
->
setStartDir
(
url
.
adjusted
(
QUrl
::
RemoveFilename
|
QUrl
::
StripTrailingSlash
));
}
}
...
...
vpn/vpnc/vpnc.cpp
View file @
2d26a219
...
...
@@ -268,7 +268,7 @@ NMVariantMapMap VpncUiPlugin::importConnectionSettings(const QString &fileName)
list
<<
ipRoute
;
}
QList
<
QList
<
uint
>>
dbusRoutes
;
for
(
const
NetworkManager
::
IpRoute
&
route
:
qAsC
onst
(
list
))
{
for
(
const
NetworkManager
::
IpRoute
&
route
:
std
::
as_c
onst
(
list
))
{
QList
<
uint
>
dbusRoute
;
dbusRoute
<<
htonl
(
route
.
ip
().
toIPv4Address
())
<<
route
.
prefixLength
()
<<
htonl
(
route
.
nextHop
().
toIPv4Address
())
<<
route
.
metric
();
dbusRoutes
<<
dbusRoute
;
...
...
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