QNI: Update the manual test 'transportMedium' naming
I staged the manual test a little too soon, forgetting it's not compiled in CI Change-Id: Iaae8b8caaf8433c45e66ff662bb9bb7b25a3b8bd Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
1834fcad33
commit
e4a09b0194
@ -46,7 +46,7 @@ class MainWindow : public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
using Reachability = QNetworkInformation::Reachability;
|
||||
using TransportMedia = QNetworkInformation::TransportMedia;
|
||||
using TransportMedium = QNetworkInformation::TransportMedium;
|
||||
|
||||
public:
|
||||
MainWindow() : QMainWindow(nullptr)
|
||||
@ -68,9 +68,9 @@ public slots:
|
||||
updateText();
|
||||
}
|
||||
|
||||
void updateTransportMedia(TransportMedia newValue)
|
||||
void updateTransportMedium(TransportMedium newValue)
|
||||
{
|
||||
transportMedia = newValue;
|
||||
transportMedium = newValue;
|
||||
updateText();
|
||||
}
|
||||
|
||||
@ -78,15 +78,15 @@ private:
|
||||
void updateText()
|
||||
{
|
||||
QString str =
|
||||
QLatin1String("Reachability: %1\nBehind captive portal: %2\nTransport media: %3")
|
||||
QLatin1String("Reachability: %1\nBehind captive portal: %2\nTransport medium: %3")
|
||||
.arg(enumToString(reachability), QStringView(captive ? u"true" : u"false"),
|
||||
enumToString(transportMedia));
|
||||
enumToString(transportMedium));
|
||||
label->setText(str);
|
||||
}
|
||||
|
||||
QLabel *const label = new QLabel(this);
|
||||
Reachability reachability = Reachability::Unknown;
|
||||
TransportMedia transportMedia = TransportMedia::Unknown;
|
||||
TransportMedium transportMedium = TransportMedium::Unknown;
|
||||
bool captive = false;
|
||||
};
|
||||
|
||||
|
@ -48,7 +48,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (!QNetworkInformation::load(QNetworkInformation::Feature::Reachability
|
||||
| QNetworkInformation::Feature::CaptivePortal
|
||||
| QNetworkInformation::Feature::TransportMedia)) {
|
||||
| QNetworkInformation::Feature::TransportMedium)) {
|
||||
qWarning("Failed to load any backend");
|
||||
qDebug() << "Backends available:" << QNetworkInformation::availableBackends().join(", ");
|
||||
return -1;
|
||||
@ -65,9 +65,9 @@ int main(int argc, char **argv)
|
||||
QObject::connect(info, &QNetworkInformation::isBehindCaptivePortalChanged,
|
||||
[&](bool status) { qDebug() << "Updated, behind captive portal:" << status; });
|
||||
|
||||
QObject::connect(info, &QNetworkInformation::transportMediaChanged,
|
||||
[&](QNetworkInformation::TransportMedia newMedia) {
|
||||
qDebug() << "Updated, current transport media:" << newMedia;
|
||||
QObject::connect(info, &QNetworkInformation::transportMediumChanged,
|
||||
[&](QNetworkInformation::TransportMedium newMedium) {
|
||||
qDebug() << "Updated, current transport medium:" << newMedium;
|
||||
});
|
||||
|
||||
#ifdef MOBILE
|
||||
@ -76,13 +76,13 @@ int main(int argc, char **argv)
|
||||
&MainWindow::updateReachability);
|
||||
QObject::connect(info, &QNetworkInformation::isBehindCaptivePortalChanged, &window,
|
||||
&MainWindow::updateCaptiveState);
|
||||
QObject::connect(info, &QNetworkInformation::transportMediaChanged, &window,
|
||||
&MainWindow::updateTransportMedia);
|
||||
QObject::connect(info, &QNetworkInformation::transportMediumChanged, &window,
|
||||
&MainWindow::updateTransportMedium);
|
||||
#endif
|
||||
|
||||
qDebug() << "Initial reachability:" << info->reachability();
|
||||
qDebug() << "Behind captive portal:" << info->isBehindCaptivePortal();
|
||||
qDebug() << "Transport media:" << info->transportMedia();
|
||||
qDebug() << "Transport medium:" << info->transportMedium();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user