CQtDeployer/Deploy/distrostruct.cpp

75 lines
1.8 KiB
C++
Raw Normal View History

2019-08-25 12:06:01 +03:00
#include "distrostruct.h"
2019-08-25 12:35:31 +03:00
#include <QRegExp>
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-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) {
libOutDir = value;
}
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) {
binOutDir = value;
}
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) {
qmlOutDir = value;
}
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) {
trOutDir = value;
}
2019-08-25 12:35:31 +03:00
QString DistroStruct::getResOutDeir(const QString &basePath) const {
return getRelativePath(basePath) + resOutDeir;
2019-08-25 12:06:01 +03:00
}
void DistroStruct::setResOutDeir(const QString &value) {
resOutDeir = value;
}
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) {
pluginsOutDir = value;
}
2019-08-25 12:35:31 +03:00
QString DistroStruct::getRelativePath(QString path) const {
if (!path.size() || !(path[0] == "/" || path[0] == "\\"))
return "";
int count = path.count(QRegExp("[\\/]")) - 1;
for (int i = 0; i < count; ++i) {
path += "../";
}
return path;
}
2019-08-25 12:06:01 +03:00
DistroStruct::DistroStruct() {
}