1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-03 06:24:48 -04:00

SkyMap: Fix CORS and enabling caching.

This commit is contained in:
srcejon
2024-02-27 15:40:48 +00:00
parent e0839fce82
commit c9c605f448
4 changed files with 15 additions and 7 deletions
+12
View File
@@ -21,11 +21,23 @@
#include <QNetworkReply>
#include <QXmlStreamReader>
#include <QDebug>
#include <QNetworkDiskCache>
WTML::WTML()
{
m_networkManager = new QNetworkAccessManager();
QObject::connect(m_networkManager, &QNetworkAccessManager::finished, this, &WTML::handleReply);
QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
QDir writeableDir(locations[0]);
if (!writeableDir.mkpath(QStringLiteral("cache") + QDir::separator() + QStringLiteral("wtml"))) {
qDebug() << "Failed to create cache/wtml";
}
m_cache = new QNetworkDiskCache();
m_cache->setCacheDirectory(locations[0] + QDir::separator() + QStringLiteral("cache") + QDir::separator() + QStringLiteral("wtml"));
m_cache->setMaximumCacheSize(100000000);
m_networkManager->setCache(m_cache);
}
WTML::~WTML()