This commit is contained in:
Martin Rotter 2022-02-02 13:01:12 +01:00
parent c360450e62
commit 560b20d20c
3 changed files with 16 additions and 1 deletions

View File

@ -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: "

View File

@ -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) {}

View File

@ -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;