Commit 595fb58e authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #5538 from DonLakeFlyer/MapInternetTest

Internet availability test fixes
parents eb1fcc59 62d3098e
......@@ -668,3 +668,8 @@ void QGCApplication::qmlAttemptWindowClose(void)
{
QMetaObject::invokeMethod(_rootQmlObject(), "attemptWindowClose");
}
bool QGCApplication::isInternetAvailable()
{
return getQGCMapEngine()->isInternetActive();
}
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment