diff --git a/ground/src/libs/opmapcontrol/src/core/opmaps.cpp b/ground/src/libs/opmapcontrol/src/core/opmaps.cpp index 6f2d0592d..3b2ef6b64 100644 --- a/ground/src/libs/opmapcontrol/src/core/opmaps.cpp +++ b/ground/src/libs/opmapcontrol/src/core/opmaps.cpp @@ -100,9 +100,15 @@ namespace core { } if(accessmode!=AccessMode::CacheOnly) { + QEventLoop q; QNetworkReply *reply; QNetworkRequest qheader; QNetworkAccessManager network; + QTimer tT; + tT.setSingleShot(true); + connect(&network, SIGNAL(finished(QNetworkReply*)), + &q, SLOT(quit())); + connect(&tT, SIGNAL(timeout()), &q, SLOT(quit())); network.setProxy(Proxy); #ifdef DEBUG_GMAPS qDebug()<<"Try Tile from the Internet"; @@ -189,28 +195,13 @@ namespace core { break; } reply=network.get(qheader); -#ifdef DEBUG_GMAPS - qDebug()<<"Starting get response ";//<isFinished() || (time.elapsed()>(Timeout))) ){QCoreApplication::processEvents(QEventLoop::AllEvents);} -#ifdef DEBUG_TIMINGS - qDebug()<<"Network time:"<error()<<" abort?"<<(time.elapsed()>Timeout); -#endif //DEBUG_GMAPS - if( (reply->error()!=QNetworkReply::NoError) || (time.elapsed()>Timeout)) - { -#ifdef DEBUG_GMAPS - qDebug()<<"Request timed out ";//<readAll(); reply->deleteLater();//TODO can't this be global?? if(ret.isEmpty())