4
1
mirror of https://github.com/QuasarApp/CQtDeployer.git synced 2025-04-28 10:44:33 +00:00
CQtDeployer/Deploy/distrostruct.cpp

101 lines
2.6 KiB
C++
Raw Normal View History

2019-08-25 12:06:01 +03:00
//#
//# Copyright (C) 2018-2019 QuasarApp.
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
2019-09-15 17:38:47 +03:00
#include "distrostruct.h"
#include "pathutils.h"
2019-09-15 17:38:47 +03:00
#include <quasarapp.h>
2019-08-25 12:35:31 +03:00
QString DistroStruct::getLibOutDir(const QString &basePath) const {
return getRelativePath(basePath) + libOutDir;
2019-08-25 12:06:01 +03:00
}
void DistroStruct::setLibOutDir(const QString &value) {
2019-08-28 18:03:55 +03:00
libOutDir = toFullPath(value);
2019-08-25 12:06:01 +03:00
}
2019-08-25 12:35:31 +03:00
QString DistroStruct::getBinOutDir(const QString &basePath) const {
return getRelativePath(basePath) + binOutDir;
2019-08-25 12:06:01 +03:00
}
void DistroStruct::setBinOutDir(const QString &value) {
2019-08-28 18:03:55 +03:00
binOutDir = toFullPath(value);
2019-08-25 12:06:01 +03:00
}
2019-08-25 12:35:31 +03:00
QString DistroStruct::getQmlOutDir(const QString &basePath) const {
return getRelativePath(basePath) + qmlOutDir;
2019-08-25 12:06:01 +03:00
}
void DistroStruct::setQmlOutDir(const QString &value) {
2019-08-28 18:03:55 +03:00
qmlOutDir = toFullPath(value);
2019-08-25 12:06:01 +03:00
}
2019-08-25 12:35:31 +03:00
QString DistroStruct::getTrOutDir(const QString &basePath) const {
return getRelativePath(basePath) + trOutDir;
2019-08-25 12:06:01 +03:00
}
void DistroStruct::setTrOutDir(const QString &value) {
2019-08-28 18:03:55 +03:00
trOutDir = toFullPath(value);
2019-08-25 12:06:01 +03:00
}
2019-08-26 21:16:47 +03:00
QString DistroStruct::getResOutDir(const QString &basePath) const {
return getRelativePath(basePath) + resOutDir;
2019-08-25 12:06:01 +03:00
}
2019-08-26 21:16:47 +03:00
void DistroStruct::setResOutDir(const QString &value) {
2019-08-28 18:03:55 +03:00
resOutDir = toFullPath(value);
2019-08-25 12:06:01 +03:00
}
2019-08-25 12:35:31 +03:00
QString DistroStruct::getPluginsOutDir(const QString &basePath) const {
return getRelativePath(basePath) + pluginsOutDir;
2019-08-25 12:06:01 +03:00
}
void DistroStruct::setPluginsOutDir(const QString &value) {
2019-08-28 18:03:55 +03:00
pluginsOutDir = toFullPath(value);
2019-08-25 12:06:01 +03:00
}
QString DistroStruct::getRootDir(const QString &basePath) const {
return getRelativePath(basePath);
}
2019-09-15 17:38:47 +03:00
void DistroStruct::init() {
#ifdef Q_OS_LINUX
setBinOutDir(QuasarAppUtils::Params::getStrArg("binOut", "/bin"));
setLibOutDir(QuasarAppUtils::Params::getStrArg("libOut", "/lib"));
#else
setBinOutDir(QuasarAppUtils::Params::getStrArg("binOut", "/"));
setLibOutDir(QuasarAppUtils::Params::getStrArg("libOut", "/"));
#endif
setQmlOutDir(QuasarAppUtils::Params::getStrArg("qmlOut", "/qml"));
setTrOutDir(QuasarAppUtils::Params::getStrArg("trOut", "/translations"));
setPluginsOutDir(QuasarAppUtils::Params::getStrArg("pluginOut", "/plugins"));
setResOutDir("/resources");
}
2019-08-28 18:03:55 +03:00
QString DistroStruct::toFullPath(QString path) const {
return PathUtils::toFullPath(path);
2019-08-28 18:03:55 +03:00
}
QString DistroStruct::stripPath(QString path) const {
return PathUtils::stripPath(path);
2019-08-28 18:03:55 +03:00
}
QString DistroStruct::getRelativePath(QString path) const {
return PathUtils::getReleativePath(path);
2019-08-25 12:35:31 +03:00
}
2019-08-25 12:06:01 +03:00
DistroStruct::DistroStruct() {
2019-08-26 17:05:18 +03:00
2019-08-25 12:06:01 +03:00
}