From e07c695b95a4f10b6c876f9431f3242c15a88ca5 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Wed, 19 May 2021 10:10:06 +0200 Subject: [PATCH] Better default NODE_PATH values especially for linux and macosx. --- pri/build_opts.pri | 8 +------- .../desktop/com.github.rssguard.appdata.xml | 2 +- .../network-web/adblock/adblockmanager.cpp | 18 ++++++++---------- src/rssguard/main.cpp | 2 +- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/pri/build_opts.pri b/pri/build_opts.pri index ff1a08a41..a84ba8e31 100644 --- a/pri/build_opts.pri +++ b/pri/build_opts.pri @@ -28,13 +28,7 @@ gcc|g++|clang* { msvc { QMAKE_CXXFLAGS *= /std:c++17 - - # Link statically to runtime. - # QMAKE_CXXFLAGS_RELEASE *= /MT - # QMAKE_CXXFLAGS_DEBUG *= /MTd - # QMAKE_CXXFLAGS -= /MDd -MDd - # QMAKE_CXXFLAGS_RELEASE -= /MDd -MDd - # QMAKE_CXXFLAGS_DEBUG -= /MDd -MDd + QMAKE_CXXFLAGS *= /wd5240 } clang* { diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index a3fcc13e9..0fccbcbc8 100644 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -30,7 +30,7 @@ https://martinrotter.github.io/donate/ - + none diff --git a/src/librssguard/network-web/adblock/adblockmanager.cpp b/src/librssguard/network-web/adblock/adblockmanager.cpp index 1f99dc1e1..3c968af34 100644 --- a/src/librssguard/network-web/adblock/adblockmanager.cpp +++ b/src/librssguard/network-web/adblock/adblockmanager.cpp @@ -298,21 +298,19 @@ QProcess* AdBlockManager::restartServer(int port) { proc->setProcessEnvironment(QProcessEnvironment::systemEnvironment()); auto pe = proc->processEnvironment(); - QString node_path = + QString default_node_path = #if defined(Q_OS_WIN) - pe.value(QSL("APPDATA")) + + pe.value(QSL("APPDATA")) + QDir::separator() + QSL("npm") + QDir::separator() + QSL("node_modules"); #elif defined(Q_OS_LINUX) - QSL("/usr/local/lib/node_modules") + + QSL("/usr/lib/node_modules"); +#elif defined(Q_OS_MACOS) + QSL("/usr/local/lib/node_modules"); #else - QDir::toNativeSeparators(IOFactory::getSystemFolder(QStandardPaths::StandardLocation::GenericDataLocation)) + + QSL(""); #endif - QDir::separator() + - QSL("npm") + - QDir::separator() + - QSL("node_modules"); - if (!pe.contains(QSL("NODE_PATH"))) { - pe.insert(QSL("NODE_PATH"), node_path); + if (!pe.contains(QSL("NODE_PATH")) && !default_node_path.isEmpty()) { + pe.insert(QSL("NODE_PATH"), default_node_path); } proc->setProcessEnvironment(pe); diff --git a/src/rssguard/main.cpp b/src/rssguard/main.cpp index 9aaa1236d..136cb59c6 100755 --- a/src/rssguard/main.cpp +++ b/src/rssguard/main.cpp @@ -8,7 +8,7 @@ #include "miscellaneous/application.h" #include "services/abstract/label.h" -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) #include #endif