diff --git a/src/ui/map3D/Q3DWidget.cc b/src/ui/map3D/Q3DWidget.cc index ec730d362dccd143b91feb63a76685399a7163d1..c3a7370fe475f61a971ca6b48616d53100e4665e 100755 --- a/src/ui/map3D/Q3DWidget.cc +++ b/src/ui/map3D/Q3DWidget.cc @@ -33,11 +33,8 @@ This file is part of the QGROUNDCONTROL project #include -//#include -//#include - static const float KEY_ROTATE_AMOUNT = 5.0f; -static const float KEY_MOVE_AMOUNT = 10.0f; +static const float KEY_MOVE_AMOUNT = 5.0f; static const float KEY_ZOOM_AMOUNT = 5.0f; Q3DWidget::Q3DWidget(QWidget* parent) diff --git a/src/ui/map3D/QMap3DWidget.cc b/src/ui/map3D/QMap3DWidget.cc index 97b3505e376aeb70c3c1680dd563bc7aba35d940..bcf94727e8e6c3ecb2d432fca64bda42a102dbdb 100644 --- a/src/ui/map3D/QMap3DWidget.cc +++ b/src/ui/map3D/QMap3DWidget.cc @@ -64,8 +64,6 @@ QMap3DWidget::QMap3DWidget(QWidget* parent) buildLayout(); - //font.reset(new FTTextureFont("images/Vera.ttf")); - connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); } diff --git a/src/ui/map3D/WebImageCache.cc b/src/ui/map3D/WebImageCache.cc index 9074832aa4e30b6fad0d522def009d16432a8265..77e3f716600b78d17ffaf8cd4b0b159ca421a7a4 100644 --- a/src/ui/map3D/WebImageCache.cc +++ b/src/ui/map3D/WebImageCache.cc @@ -54,66 +54,68 @@ WebImageCache::WebImageCache(QObject* parent, uint32_t _cacheSize) QPair WebImageCache::lookup(const QString& url) { - QPair p; + QPair cacheEntry; + for (int32_t i = 0; i < webImages.size(); ++i) { if (webImages[i]->getState() != WebImage::UNINITIALIZED && webImages[i]->getSourceURL() == url) { - p.first = webImages[i]; - p.second = i; + cacheEntry.first = webImages[i]; + cacheEntry.second = i; break; } } - if (p.first.isNull()) + if (cacheEntry.first.isNull()) { for (int32_t i = 0; i < webImages.size(); ++i) { // get uninitialized image if (webImages[i]->getState() == WebImage::UNINITIALIZED) { - p.first = webImages[i]; - p.second = i; + cacheEntry.first = webImages[i]; + cacheEntry.second = i; break; } // get oldest image else if (webImages[i]->getState() == WebImage::READY && - (p.first.isNull() || - p.first->getLastReference() < p.first->getLastReference())) + (cacheEntry.first.isNull() || + webImages[i]->getLastReference() < + cacheEntry.first->getLastReference())) { - p.first = webImages[i]; - p.second = i; + cacheEntry.first = webImages[i]; + cacheEntry.second = i; } } - if (p.first.isNull()) + if (cacheEntry.first.isNull()) { return qMakePair(WebImagePtr(), -1); } else { - if (p.first->getState() == WebImage::READY) + if (cacheEntry.first->getState() == WebImage::READY) { - p.first->clear(); + cacheEntry.first->clear(); } - p.first->setSourceURL(url); - p.first->setLastReference(currentReference); + cacheEntry.first->setSourceURL(url); + cacheEntry.first->setLastReference(currentReference); ++currentReference; - p.first->setState(WebImage::REQUESTED); + cacheEntry.first->setState(WebImage::REQUESTED); networkManager->get(QNetworkRequest(QUrl(url))); - return p; + return cacheEntry; } } else { - if (p.first->getState() == WebImage::READY) + if (cacheEntry.first->getState() == WebImage::READY) { - p.first->setLastReference(currentReference); + cacheEntry.first->setLastReference(currentReference); ++currentReference; - return p; + return cacheEntry; } else {