Commit f5cdf449 authored by Gus Grubba's avatar Gus Grubba

Windows fixes

parent f30a47d9
......@@ -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
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);
}
//-----------------------------------------------------------------------------
......
......@@ -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);
}
}
......
......@@ -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()
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;
}
......
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