Browse Source

Windows fixes

QGC4.4
Gus Grubba 9 years ago
parent
commit
f5cdf4497a
  1. 5
      src/QtLocationPlugin/QGCMapEngine.cpp
  2. 6
      src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
  3. 5
      src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc

5
src/QtLocationPlugin/QGCMapEngine.cpp

@ -33,6 +33,7 @@ This file is part of the QGROUNDCONTROL project @@ -33,6 +33,7 @@ This file is part of the QGROUNDCONTROL project
#include <QSettings>
#include <QStandardPaths>
#include <QDir>
#include <stdio.h>
#include "QGCMapEngine.h"
#include "QGCMapTileSet.h"
@ -208,9 +209,7 @@ QGCMapEngine::cacheTile(UrlFactory::MapType type, const QString& hash, const QBy @@ -208,9 +209,7 @@ QGCMapEngine::cacheTile(UrlFactory::MapType type, const QString& hash, const QBy
QString
QGCMapEngine::getTileHash(UrlFactory::MapType type, int x, int y, int z)
{
char hashSource[64];
snprintf(hashSource, sizeof(hashSource), "%04d%08d%08d%03d", (int)type, x, y, z);
return QString(hashSource);
return QString().sprintf("%04d%08d%08d%03d", (int)type, x, y, z);
}
//-----------------------------------------------------------------------------

6
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp

@ -226,9 +226,13 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap &parameters) @@ -226,9 +226,13 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap &parameters)
QGeoTileCache* pTileCache = createTileCacheWithDir(cacheDir);
if(pTileCache)
{
//-- We're basically telling it to use 1kb of disk for cache. It doesn't like
//-- We're basically telling it to use 1kb (100k for Windows) of disk for cache. It doesn't like
// values smaller than that and I could not find a way to make it NOT cache.
#ifdef Q_OS_WIN
pTileCache->setMaxDiskUsage(1024 * 100);
#else
pTileCache->setMaxDiskUsage(1024);
#endif
pTileCache->setMaxMemoryUsage(memLimit);
}
}

5
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc

@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
#include "QGCMapTileSet.h"
#include "QGCMapUrlEngine.h"
#include <QStorageInfo>
#include <stdio.h>
QGC_LOGGING_CATEGORY(QGCMapEngineManagerLog, "QGCMapEngineManagerLog")
@ -378,10 +379,8 @@ QGCMapEngineManager::getUniqueName() @@ -378,10 +379,8 @@ QGCMapEngineManager::getUniqueName()
QString name;
int count = 1;
while (true) {
char numb[16];
snprintf(numb, sizeof(numb), "%03d", count++);
name = test;
name += numb;
name += QString().sprintf("%03d", count++);
if(!findName(name))
return name;
}

Loading…
Cancel
Save