diff --git a/src/librssguard/definitions/definitions.h b/src/librssguard/definitions/definitions.h index de6a65c15..180e4d79d 100644 --- a/src/librssguard/definitions/definitions.h +++ b/src/librssguard/definitions/definitions.h @@ -130,6 +130,7 @@ #define LOGSEC_JS "javascript: " #define LOGSEC_GUI "gui: " #define LOGSEC_CORE "core: " +#define LOGSEC_NODEJS "nodejs: " #define LOGSEC_DB "database: " #define LOGSEC_NEXTCLOUD "nextcloud: " #define LOGSEC_GREADER "greader: " diff --git a/src/librssguard/miscellaneous/nodejs.cpp b/src/librssguard/miscellaneous/nodejs.cpp index 5f0c638c5..891dd7435 100644 --- a/src/librssguard/miscellaneous/nodejs.cpp +++ b/src/librssguard/miscellaneous/nodejs.cpp @@ -3,6 +3,7 @@ #include "miscellaneous/nodejs.h" #include "exceptions/applicationexception.h" +#include "miscellaneous/application.h" #include "miscellaneous/iofactory.h" #include "miscellaneous/settings.h" @@ -27,7 +28,19 @@ void NodeJs::setNpmExecutable(const QString& exe) const { } QString NodeJs::packageFolder() const { - return QDir::toNativeSeparators(m_settings->value(GROUP(Node), SETTING(Node::PackageFolder)).toString()); + QString path = QDir::toNativeSeparators(m_settings->value(GROUP(Node), SETTING(Node::PackageFolder)).toString()); + + return path; +} + +QString NodeJs::processedPackageFolder() const { + QString path = qApp->replaceDataUserDataFolderPlaceholder(packageFolder()); + + if (!QDir().mkpath(path)) { + qCriticalNN << LOGSEC_NODEJS << "Failed to create package folder structure" << QUOTE_W_SPACE_DOT(path); + } + + return path; } void NodeJs::setPackageFolder(const QString& path) {} diff --git a/src/librssguard/miscellaneous/nodejs.h b/src/librssguard/miscellaneous/nodejs.h index ed3202c04..5e406652d 100644 --- a/src/librssguard/miscellaneous/nodejs.h +++ b/src/librssguard/miscellaneous/nodejs.h @@ -20,6 +20,7 @@ class NodeJs : public QObject { void setNpmExecutable(const QString& exe) const; QString packageFolder() const; + QString processedPackageFolder() const; void setPackageFolder(const QString& path); QString nodejsVersion(const QString& nodejs_exe) const;