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
Network
KDE Connect
Commits
ef0efc36
Commit
ef0efc36
authored
Mar 04, 2022
by
Michael Prager
Committed by
Albert Vaca Cintora
Mar 10, 2022
Browse files
[Connectivity Report] Fixed crash if signalStrengths is empty.
BUG: 449276
parent
19b8249e
Pipeline
#148735
passed with stage
in 3 minutes and 31 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
plugins/connectivity-report/connectivity_reportplugin.cpp
View file @
ef0efc36
...
...
@@ -41,17 +41,19 @@ bool ConnectivityReportPlugin::receivePacket(const NetworkPacket& np)
{
if
(
np
.
type
()
==
PACKET_TYPE_CONNECTIVITY_REPORT
)
{
auto
subscriptions
=
np
.
get
<
QVariantMap
>
(
QStringLiteral
(
"signalStrengths"
),
QVariantMap
());
auto
networkInfo
=
subscriptions
.
first
().
toMap
();
if
(
!
subscriptions
.
isEmpty
())
{
auto
networkInfo
=
subscriptions
.
first
().
toMap
();
const
auto
oldCellularNetworkType
=
m_cellularNetworkType
;
const
auto
oldNetworkStrength
=
m_cellularNetworkStrength
;
const
auto
oldCellularNetworkType
=
m_cellularNetworkType
;
const
auto
oldNetworkStrength
=
m_cellularNetworkStrength
;
m_cellularNetworkType
=
networkInfo
.
value
(
QStringLiteral
(
"networkType"
)).
toString
();
m_cellularNetworkStrength
=
networkInfo
.
value
(
QStringLiteral
(
"signalStrength"
)).
toInt
();
m_cellularNetworkType
=
networkInfo
.
value
(
QStringLiteral
(
"networkType"
)).
toString
();
m_cellularNetworkStrength
=
networkInfo
.
value
(
QStringLiteral
(
"signalStrength"
)).
toInt
();
if
(
oldCellularNetworkType
!=
m_cellularNetworkType
||
oldNetworkStrength
!=
m_cellularNetworkStrength
)
{
Q_EMIT
refreshed
(
m_cellularNetworkType
,
m_cellularNetworkStrength
);
if
(
oldCellularNetworkType
!=
m_cellularNetworkType
||
oldNetworkStrength
!=
m_cellularNetworkStrength
)
{
Q_EMIT
refreshed
(
m_cellularNetworkType
,
m_cellularNetworkStrength
);
}
}
}
...
...
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