Skip to content

Commit

Permalink
Merge branch 'main' of github.com:QuasarApp/CQtDeployer
Browse files Browse the repository at this point in the history
  • Loading branch information
EndrII committed Oct 27, 2021
2 parents e2a2cd7 + 3a0d661 commit e18c8b7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
18 changes: 16 additions & 2 deletions Deploy/extracter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,22 @@ bool Extracter::copyTr() {

const auto trFiles = i->tr();
for (const auto &tr: trFiles) {
if (!_fileManager->copyFile(tr, cnf->getPackageTargetDir(i.key()) + i->getTrOutDir())) {
return false;

QFileInfo info(tr);

if (info.isDir()) {
QDir dir(info.absoluteFilePath());
auto availableQm = dir.entryInfoList({"*.qm"}, QDir::Files);
for (const auto & trFile : qAsConst(availableQm)) {
if (!_fileManager->copyFile(trFile.absoluteFilePath(),
cnf->getPackageTargetDir(i.key()) + i->getTrOutDir())) {
return false;
}
}
} else {
if (!_fileManager->copyFile(tr, cnf->getPackageTargetDir(i.key()) + i->getTrOutDir())) {
return false;
}
}
}
}
Expand Down
17 changes: 9 additions & 8 deletions UnitTests/tst_deploytest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,21 +1190,22 @@ void deploytest::testDeployGeneralFiles() {
void deploytest::testTr() {
TestUtils utils;
#ifdef Q_OS_UNIX
QString bin = TestBinDir + "QtWidgetsProject";
QString qmake = TestQtDir + "bin/qmake";
QString bin = TestBinDir + "TestOnlyC";

#else
QString bin = TestBinDir + "QtWidgetsProject.exe";
QString qmake = TestQtDir + "bin/qmake.exe";
QString bin = TestBinDir + "TestOnlyC.exe";

#endif
auto comapareTree = TestModule.qtLibs();

comapareTree += utils.createTree({"./" + DISTRO_DIR + "/translations/TestTr.qm"});
runTestParams({"-bin", bin, "clear" ,
"-tr", ":/testResurces/testRes/TestTr.qm",});

QVERIFY(QFile::exists("./" + DISTRO_DIR + "/translations/TestTr.qm"));

runTestParams({"-bin", bin, "clear" ,
"-tr", ":/testResurces/testRes/TestTr.qm",
"-qmake", qmake}, &comapareTree);
"-tr", ":/testResurces/testRes/"});

QVERIFY(QFile::exists("./" + DISTRO_DIR + "/translations/TestTr.qm"));
}

void deploytest::testVirtualKeyBoard() {
Expand Down

0 comments on commit e18c8b7

Please sign in to comment.