diff options
author | Mårten Nordheim <[email protected]> | 2021-11-03 14:07:42 +0100 |
---|---|---|
committer | Mårten Nordheim <[email protected]> | 2021-11-04 12:02:34 +0100 |
commit | 58b37f5908be86a478f20cbbe70228009bd3a481 (patch) | |
tree | 240e4e5b3121b9eaacb984b7ea82a3a594d5fe9a | |
parent | 83ddf49bc71736a19f27e6e8b72831ea72e441cc (diff) |
QNI manual test: Remove unnecessary capturing and wrapping
No need to capture anything by reference, it's a leftover from when
the MainWindow was changed from inside the lambda.
And no need to wrap the argument to QLatin1String.arg() with QStringView
explicitly. This change is made just for brevity and consistency.
Change-Id: Ib8c163bcf5932d35a9d43dd8ce124588c539d5a4
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Marc Mutz <[email protected]>
-rw-r--r-- | tests/manual/qnetworkinformation/mainwindow.h | 2 | ||||
-rw-r--r-- | tests/manual/qnetworkinformation/tst_qnetworkinformation.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/manual/qnetworkinformation/mainwindow.h b/tests/manual/qnetworkinformation/mainwindow.h index 0426bc37142..eaaeece3582 100644 --- a/tests/manual/qnetworkinformation/mainwindow.h +++ b/tests/manual/qnetworkinformation/mainwindow.h @@ -86,7 +86,7 @@ private: QString str = QLatin1String("Reachability: %1\nBehind captive portal: %2\nTransport medium: %3" "\nMetered: %4") - .arg(enumToString(reachability), QStringView(captive ? u"true" : u"false"), + .arg(enumToString(reachability), captive ? u"true" : u"false", enumToString(transportMedium), metered ? u"true" : u"false"); label->setText(str); } diff --git a/tests/manual/qnetworkinformation/tst_qnetworkinformation.cpp b/tests/manual/qnetworkinformation/tst_qnetworkinformation.cpp index fc34a36c3cd..32cb84fcf26 100644 --- a/tests/manual/qnetworkinformation/tst_qnetworkinformation.cpp +++ b/tests/manual/qnetworkinformation/tst_qnetworkinformation.cpp @@ -58,15 +58,15 @@ int main(int argc, char **argv) qDebug() << "Now you can make changes to the current network connection. Qt should see the " "changes and notify about it."; QObject::connect(info, &QNetworkInformation::reachabilityChanged, - [&](QNetworkInformation::Reachability newStatus) { + [](QNetworkInformation::Reachability newStatus) { qDebug() << "Updated:" << newStatus; }); QObject::connect(info, &QNetworkInformation::isBehindCaptivePortalChanged, - [&](bool status) { qDebug() << "Updated, behind captive portal:" << status; }); + [](bool status) { qDebug() << "Updated, behind captive portal:" << status; }); QObject::connect(info, &QNetworkInformation::transportMediumChanged, - [&](QNetworkInformation::TransportMedium newMedium) { + [](QNetworkInformation::TransportMedium newMedium) { qDebug() << "Updated, current transport medium:" << newMedium; }); |