mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-28 02:34:34 +00:00
Merge pull request #459 from QuasarApp/fixMissingIcon
Fix missing default icon of deployed projects
This commit is contained in:
commit
faa2ea40fb
@ -179,7 +179,7 @@ bool iDistribution::collectInfo(
|
||||
|
||||
info.Icon = "icons/Icon.png";
|
||||
if (package.icon().isEmpty()) {
|
||||
if (!copyFile(":/Templates/QIF/Distributions/Templates/Icon.png",
|
||||
if (!copyFile(":/shared/Distributions/Templates/Icon.png",
|
||||
localData + "/icons/", false)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1264,7 +1264,14 @@ QString ConfigParser::findWindowsPath(const QString& path) const {
|
||||
QList<iDistribution *> ConfigParser::getDistribution() {
|
||||
QList<iDistribution *> distros;
|
||||
if (QuasarAppUtils::Params::isEndable("deb")) {
|
||||
#ifdef Q_OS_LINUX
|
||||
distros.push_back(new Deb(_fileManager));
|
||||
#else
|
||||
QuasarAppUtils::Params::log("The deb option availabel only on Linux host palatforms,"
|
||||
" please remove this options from your deploy command",
|
||||
QuasarAppUtils::Warning);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
if (QuasarAppUtils::Params::isEndable("zip")) {
|
||||
|
@ -65,13 +65,8 @@ bool FileManager::addToDeployed(const QString& path) {
|
||||
if (info.isFile() || !info.exists()) {
|
||||
_deployedFiles += info.absoluteFilePath();
|
||||
|
||||
auto completeSufix = info.completeSuffix();
|
||||
if (info.isFile() && (completeSufix.isEmpty() || completeSufix.toLower() == "run"
|
||||
|| completeSufix.toLower() == "sh")) {
|
||||
|
||||
if (!QFile::setPermissions(path, static_cast<QFile::Permission>(0x7775))) {
|
||||
QuasarAppUtils::Params::log("permishens set fail", QuasarAppUtils::Warning);
|
||||
}
|
||||
if (!QFile::setPermissions(path, static_cast<QFile::Permission>(0x7775))) {
|
||||
QuasarAppUtils::Params::log("permishens set fail", QuasarAppUtils::Warning);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
@ -162,8 +157,8 @@ bool FileManager::fileActionPrivate(const QString &file, const QString &target,
|
||||
}
|
||||
|
||||
if (!copy) {
|
||||
QuasarAppUtils::Params::log(((isMove)? "skip move :": "skip copy :" + file));
|
||||
return false;
|
||||
QuasarAppUtils::Params::log(((isMove)? "skip move :": "skip copy (by mask):" + file ));
|
||||
return true;
|
||||
}
|
||||
|
||||
auto name = info.fileName();
|
||||
@ -193,49 +188,23 @@ bool FileManager::fileActionPrivate(const QString &file, const QString &target,
|
||||
QFile sourceFile(file);
|
||||
auto sourceFileAbsalutePath = QFileInfo(file).absoluteFilePath();
|
||||
|
||||
bool tarExits = QFileInfo(tergetFile).exists();
|
||||
if (tarExits && !QuasarAppUtils::Params::isEndable("noOverwrite")) {
|
||||
QuasarAppUtils::Params::log(tergetFile + " already exists!",
|
||||
QuasarAppUtils::Info);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!((isMove)?
|
||||
sourceFile.rename(tergetFile):
|
||||
sourceFile.copy(tergetFile))) {
|
||||
|
||||
QuasarAppUtils::Params::log("Qt Operation fail " + file + " >> " + tergetFile +
|
||||
" Qt error: " + sourceFile.errorString(),
|
||||
QuasarAppUtils::Warning);
|
||||
QuasarAppUtils::Params::log("Operation fail " + file + " >> " + tergetFile,
|
||||
QuasarAppUtils::Error);
|
||||
|
||||
bool tarExits = QFileInfo(tergetFile).exists();
|
||||
|
||||
if ((!tarExits) ||
|
||||
(tarExits && !QuasarAppUtils::Params::isEndable("noOverwrite"))) {
|
||||
|
||||
std::ifstream src(file.toStdString(),
|
||||
std::ios::binary);
|
||||
|
||||
std::ofstream dst((tergetFile).toStdString(),
|
||||
std::ios::binary);
|
||||
|
||||
dst << src.rdbuf();
|
||||
|
||||
if (!QFileInfo::exists(tergetFile)) {
|
||||
QuasarAppUtils::Params::log("std Operation fail file not copied. "
|
||||
"Сheck if you have access to the target dir",
|
||||
QuasarAppUtils::Error);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (isMove && std::remove(file.toStdString().c_str())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (QFileInfo(tergetFile).exists()) {
|
||||
QuasarAppUtils::Params::log(tergetFile + " already exists!",
|
||||
QuasarAppUtils::Info);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
QuasarAppUtils::Params::log(sourceFile.errorString(),
|
||||
QuasarAppUtils::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isMove) {
|
||||
@ -512,15 +481,15 @@ bool FileManager::removeFile(const QFileInfo &file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!QFile::remove(file.absoluteFilePath())) {
|
||||
QFile f(file.absoluteFilePath());
|
||||
if (!f.remove()) {
|
||||
QuasarAppUtils::Params::log("Qt Operation fail (remove file) " + file.absoluteFilePath(),
|
||||
QuasarAppUtils::Warning);
|
||||
QuasarAppUtils::Error);
|
||||
|
||||
if (remove(file.absoluteFilePath().toLatin1())) {
|
||||
QuasarAppUtils::Params::log("std Operation fail file not removed." + file.absoluteFilePath(),
|
||||
QuasarAppUtils::Error);
|
||||
return false;
|
||||
}
|
||||
QuasarAppUtils::Params::log("Message: " + f.errorString(),
|
||||
QuasarAppUtils::Error);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -17,7 +17,7 @@ QSet<QString> ModulesQt515::qtLibs(const QString &distDir) const {
|
||||
auto res = ModulesQt514::qtLibs(distDir);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
res -= utils.createTree({
|
||||
res += utils.createTree({
|
||||
"./" + distDir + "/translations/qtbase_tr.qm",
|
||||
});
|
||||
#else
|
||||
|
@ -2477,7 +2477,7 @@ void deploytest::testSystemLib() {
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"deploySystem"
|
||||
}, &comapareTree, {}, true);
|
||||
}, &comapareTree);
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user