mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-27 10:14:32 +00:00
66 lines
1.7 KiB
C++
66 lines
1.7 KiB
C++
#include "deployconfig.h"
|
|
|
|
void DeployConfig::reset() {
|
|
*this = DeployConfig{};
|
|
}
|
|
|
|
QHash<QString, TargetInfo*>
|
|
DeployConfig::getTargetsListByFilter(const QString &filter) {
|
|
QHash<QString, TargetInfo*> result;
|
|
|
|
for( auto it = targets.begin(); it != targets.end(); ++it) {
|
|
if (it.key().contains(filter, Qt::CaseInsensitive)) {
|
|
result.insert(it.key(), &(*it));
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
QString DeployConfig::getTargetDir(const QString &target) const {
|
|
if (targets.contains(target))
|
|
return targetDir + targets.value(target).getSufix();
|
|
return targetDir;
|
|
}
|
|
|
|
void DeployConfig::setTargetDir(const QString &target) {
|
|
targetDir = target;
|
|
}
|
|
|
|
DistroStruct DeployConfig::getDistro(const QString &target) const {
|
|
return prefixes.value(targets.value(target).getSufix());
|
|
}
|
|
|
|
bool QtDir::isQt(const QString& path) const {
|
|
|
|
return
|
|
(!libs.isEmpty() && path.contains(libs)) ||
|
|
(!bins.isEmpty() && path.contains(bins)) ||
|
|
(!libexecs.isEmpty() && path.contains(libexecs)) ||
|
|
(!plugins.isEmpty() && path.contains(plugins)) ||
|
|
(!qmls.isEmpty() && path.contains(qmls)) ||
|
|
(!translations.isEmpty() && path.contains(translations)) ||
|
|
(!resources.isEmpty() && path.contains(resources));
|
|
}
|
|
|
|
bool Extra::contains(const QString &path) const {
|
|
QFileInfo info(path);
|
|
if (extraPaths.contains(info.absolutePath())) {
|
|
return true;
|
|
}
|
|
|
|
for (auto i: extraPathsMasks) {
|
|
if (info.absoluteFilePath().contains(i)) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
for (auto i: extraNamesMasks) {
|
|
if (info.fileName().contains(i)) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|