diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index 7abc033aa72d1a49973d9552e1049234d38403e2..26a5656d8f9863b95ada271267996bca47a4ae2e 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -668,3 +668,8 @@ void QGCApplication::qmlAttemptWindowClose(void) { QMetaObject::invokeMethod(_rootQmlObject(), "attemptWindowClose"); } + +bool QGCApplication::isInternetAvailable() +{ + return getQGCMapEngine()->isInternetActive(); +} diff --git a/src/QGCApplication.h b/src/QGCApplication.h index 4d264d0f7ffe2e2ad35cd44ac03bbae0ae9fecb5..fb4ec5d94e5f893adfbe6ce75ad7d73a1c0ddc23 100644 --- a/src/QGCApplication.h +++ b/src/QGCApplication.h @@ -92,6 +92,9 @@ public: /// Do we have Bluetooth Support? bool isBluetoothAvailable() { return _bluetoothAvailable; } + /// Is Internet available? + bool isInternetAvailable(); + public slots: /// You can connect to this slot to show an information message box from a different thread. void informationMessageBoxOnMainThread(const QString& title, const QString& msg); diff --git a/src/QtLocationPlugin/QGCTileCacheWorker.cpp b/src/QtLocationPlugin/QGCTileCacheWorker.cpp index df5118bac192b68bafd650a05c398a786addbd86..eca022cbe848d923d1ed5a1e2ca9a962cad391de 100644 --- a/src/QtLocationPlugin/QGCTileCacheWorker.cpp +++ b/src/QtLocationPlugin/QGCTileCacheWorker.cpp @@ -1056,7 +1056,7 @@ void QGCCacheWorker::_testInternet() { QTcpSocket socket; - socket.connectToHost("8.8.8.8", 53); + socket.connectToHost("www.github.com", 80); if (socket.waitForConnected(2500)) { qCDebug(QGCTileCacheLog) << "Yes Internet Access"; emit internetStatus(true);