mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
OP37/GCS Fix to DB warning
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@957 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
758552b76c
commit
423b94d414
@ -193,15 +193,15 @@ namespace core {
|
||||
qDebug()<<"Starting get response ";//<<pos.X()+","+pos.Y();
|
||||
#endif //DEBUG_GMAPS
|
||||
QTime time;
|
||||
time.start();
|
||||
while( !(reply->isFinished() || (time.elapsed()>(6*Timeout))) ){QCoreApplication::processEvents(QEventLoop::AllEvents);}
|
||||
time.restart();
|
||||
while( !(reply->isFinished() || (time.elapsed()>(Timeout))) ){QCoreApplication::processEvents(QEventLoop::AllEvents);}
|
||||
#ifdef DEBUG_TIMINGS
|
||||
qDebug()<<"Network time:"<<time.elapsed();
|
||||
#endif
|
||||
#ifdef DEBUG_GMAPS
|
||||
qDebug()<<"Finished?"<<reply->error()<<" abort?"<<(time.elapsed()>Timeout*6);
|
||||
qDebug()<<"Finished?"<<reply->error()<<" abort?"<<(time.elapsed()>Timeout);
|
||||
#endif //DEBUG_GMAPS
|
||||
if( (reply->error()!=QNetworkReply::NoError) || (time.elapsed()>Timeout*6))
|
||||
if( (reply->error()!=QNetworkReply::NoError) || (time.elapsed()>Timeout))
|
||||
{
|
||||
#ifdef DEBUG_GMAPS
|
||||
qDebug()<<"Request timed out ";//<<pos.x+","+pos.y;
|
||||
|
@ -242,7 +242,11 @@ QByteArray PureImageCache::GetImageFromCache(MapType::Types type, Point pos, int
|
||||
QSqlQuery query(cn);
|
||||
query.exec(QString("SELECT Tile FROM TilesData WHERE id = (SELECT id FROM Tiles WHERE X=%1 AND Y=%2 AND Zoom=%3 AND Type=%4)").arg(pos.X()).arg(pos.Y()).arg(zoom).arg((int) type));
|
||||
query.next();
|
||||
ar=query.value(0).toByteArray();
|
||||
if(query.isValid())
|
||||
{
|
||||
|
||||
ar=query.value(0).toByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
cn.close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user