diff --git a/plugins/feature/skymap/CMakeLists.txt b/plugins/feature/skymap/CMakeLists.txt index 5d83d879f..2466ff69a 100644 --- a/plugins/feature/skymap/CMakeLists.txt +++ b/plugins/feature/skymap/CMakeLists.txt @@ -80,12 +80,6 @@ target_link_libraries(${TARGET_NAME} install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) -if(WIN32) - # Run deployqt for QtQuick etc - include(DeployQt) - windeployqt(${TARGET_NAME} ${SDRANGEL_BINARY_BIN_DIR} ${PROJECT_SOURCE_DIR}/skymap) -endif() - # Install debug symbols if (WIN32) install(FILES $ CONFIGURATIONS Debug RelWithDebInfo DESTINATION ${INSTALL_FOLDER} ) diff --git a/plugins/feature/skymap/webserver.cpp b/plugins/feature/skymap/webserver.cpp index 1adb1b966..23dc85e7b 100644 --- a/plugins/feature/skymap/webserver.cpp +++ b/plugins/feature/skymap/webserver.cpp @@ -97,7 +97,7 @@ void WebServer::addFile(const QString &path, const QByteArray &data) void WebServer::sendFile(QTcpSocket* socket, const QByteArray &data, MimeType *mimeType, const QString &path) { - QString header = QString("HTTP/1.0 200 Ok\r\nContent-Type: %1\r\nAccess-Control-Allow-Origin \"*\"\r\n\r\n").arg(mimeType->m_type); + QString header = QString("HTTP/1.0 200 Ok\r\nContent-Type: %1\r\nAccess-Control-Allow-Headers: *\r\nAccess-Control-Allow-Methods: *\r\nAccess-Control-Allow-Origin: *\r\n\r\n").arg(mimeType->m_type); if (mimeType->m_binary) { // Send file as binary diff --git a/plugins/feature/skymap/wtml.cpp b/plugins/feature/skymap/wtml.cpp index c7210e2bb..d0c940903 100644 --- a/plugins/feature/skymap/wtml.cpp +++ b/plugins/feature/skymap/wtml.cpp @@ -21,11 +21,23 @@ #include #include #include +#include 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() diff --git a/plugins/feature/skymap/wtml.h b/plugins/feature/skymap/wtml.h index 6e3db15fb..ba06c0596 100644 --- a/plugins/feature/skymap/wtml.h +++ b/plugins/feature/skymap/wtml.h @@ -22,6 +22,7 @@ class QNetworkAccessManager; class QNetworkReply; +class QNetworkDiskCache; // World Wide Telescope WTML files containing imageset catalogs class WTML : public QObject @@ -48,6 +49,7 @@ signals: private: QNetworkAccessManager *m_networkManager; + QNetworkDiskCache *m_cache; };