From 8a0d0de573c0e63990436e3653c00d69df037122 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 31 May 2019 19:24:02 +0200 Subject: [PATCH] Windows build fixes --- app/main.cpp | 8 +++++++- sdrbase/webapi/webapirequestmapper.cpp | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/main.cpp b/app/main.cpp index 385bdf357..b66a2d1c3 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -34,9 +34,15 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); */ +#ifdef _MSC_VER + QCoreApplication::setOrganizationName("f4exb"); + QCoreApplication::setApplicationName("SDRangel"); + QCoreApplication::setApplicationVersion("4.8.2"); +#else QCoreApplication::setOrganizationName(COMPANY); QCoreApplication::setApplicationName(APPLICATION_NAME); - QCoreApplication::setApplicationVersion(SDRANGEL_VERSION); + QCoreApplication::setApplicationVersion(SDRANGEL_VERSION); +#endif #if QT_VERSION >= 0x050600 QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 39667022c..b8ee2d713 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -49,7 +49,9 @@ WebAPIRequestMapper::WebAPIRequestMapper(QObject* parent) : HttpRequestHandler(parent), m_adapter(0) { +#ifndef _MSC_VER Q_INIT_RESOURCE(webapi); +#endif qtwebapp::HttpDocrootSettings docrootSettings; docrootSettings.path = ":/webapi"; m_staticFileController = new qtwebapp::StaticFileController(docrootSettings, parent); @@ -58,7 +60,9 @@ WebAPIRequestMapper::WebAPIRequestMapper(QObject* parent) : WebAPIRequestMapper::~WebAPIRequestMapper() { delete m_staticFileController; +#ifndef _MSC_VER Q_CLEANUP_RESOURCE(webapi); +#endif } void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)