From 9d71220129abc623537dd8611049548d1bf5db86 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 15 Nov 2020 18:32:33 +0000 Subject: [PATCH] compile qm on the fly at the time of the build. trying to fix builds before 4.0 release. add qttools5-dev to ubuntu package list add qt5-linguist to snapcraft file add missing file --- .travis.yml | 4 +-- qt/CMakeLists.txt | 31 ++++++++++++++++-- qt/android-file-transfer.qrc | 2 -- qt/main.cpp | 2 +- .../android-file-transfer-linux_cs.qm | Bin 11520 -> 0 bytes .../android-file-transfer-linux_ru.qm | Bin 4440 -> 0 bytes qt/translations/translations.qrc.in | 5 +++ snap/snapcraft.yaml | 2 ++ 8 files changed, 39 insertions(+), 7 deletions(-) delete mode 100644 qt/translations/android-file-transfer-linux_cs.qm delete mode 100644 qt/translations/android-file-transfer-linux_ru.qm create mode 100644 qt/translations/translations.qrc.in diff --git a/.travis.yml b/.travis.yml index 4239c1e2..bc93ef07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,9 +16,9 @@ matrix: install: - | if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - sudo apt-get -y install qt5-default libfuse-dev libmagic-dev libtag1-dev libssl-dev + sudo apt-get -y install qt5-default qttools5-dev qttools5-dev-tools libfuse-dev libmagic-dev libtag1-dev libssl-dev elif [ "${TRAVIS_OS_NAME}" = "freebsd" ]; then - sudo pkg install -y ninja qt5-qmake qt5-buildtools qt5-widgets fusefs-libs pybind11 taglib + sudo pkg install -y ninja qt5-qmake qt5-buildtools qt5-widgets qt5-linguist fusefs-libs pybind11 taglib elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew tap homebrew/cask && brew install qt5 homebrew/cask/osxfuse pybind11 taglib openssl@1.1 fi diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt index df6a4734..5eec9761 100644 --- a/qt/CMakeLists.txt +++ b/qt/CMakeLists.txt @@ -4,10 +4,12 @@ if(DESIRED_QT_VERSION) else() find_package(Qt5Widgets QUIET) find_package(Qt5Network QUIET) + find_package(Qt5LinguistTools QUIET) endif() else() find_package(Qt5Widgets QUIET) find_package(Qt5Network QUIET) + find_package(Qt5LinguistTools QUIET) find_package(Qt4 QUIET) endif() @@ -40,18 +42,43 @@ set(FORMS mainwindow.ui renamedialog.ui ) +set(TS_FILES + translations/android-file-transfer-linux_cs.ts + translations/android-file-transfer-linux_it.ts + translations/android-file-transfer-linux_nl.ts + translations/android-file-transfer-linux_ru.ts +) + if (Qt5Widgets_FOUND) message(STATUS "Using Qt5") qt5_wrap_cpp(HEADERS_MOC ${HEADERS}) qt5_wrap_ui(FORMS_HEADERS ${FORMS}) - qt5_add_resources(RESOURCES android-file-transfer.qrc) + + qt5_add_translation(QM_FILES ${TS_FILES}) + set(QM_FILES_XML "") + foreach(_QM ${QM_FILES}) + get_filename_component(_QM ${_QM} NAME) + set(QM_FILES_XML "${QM_FILES_XML}${_QM}") + endforeach() + configure_file(translations/translations.qrc.in translations.qrc) + + qt5_add_resources(RESOURCES android-file-transfer.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc) include_directories(${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS}) set(EXTRA_QT_LINK ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES}) elseif(Qt4_FOUND OR QT_FOUND OR QT4_FOUND) message(STATUS "Using Qt4") qt4_wrap_cpp(HEADERS_MOC ${HEADERS}) qt4_wrap_ui(FORMS_HEADERS ${FORMS}) - qt4_add_resources(RESOURCES android-file-transfer.qrc) + + qt4_add_translation(QM_FILES ${TS_FILES}) + set(QM_FILES_XML "") + foreach(_QM ${QM_FILES}) + get_filename_component(_QM ${_QM} NAME) + set(QM_FILES_XML "${QM_FILES_XML}${_QM}") + endforeach() + configure_file(translations/translations.qrc.in translations.qrc) + + qt4_add_resources(RESOURCES android-file-transfer.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc) include(${QT_USE_FILE}) set(EXTRA_QT_LINK Qt4::QtNetwork ${QT_LIBRARIES}) else() diff --git a/qt/android-file-transfer.qrc b/qt/android-file-transfer.qrc index bfbe3cb9..92b0488e 100644 --- a/qt/android-file-transfer.qrc +++ b/qt/android-file-transfer.qrc @@ -1,8 +1,6 @@ android-file-transfer.png - translations/android-file-transfer-linux_ru.qm - translations/android-file-transfer-linux_cs.qm icons/dark/folder-new.svg icons/dark/go-next.svg icons/dark/go-previous.svg diff --git a/qt/main.cpp b/qt/main.cpp index a6aa543b..4a70feb2 100644 --- a/qt/main.cpp +++ b/qt/main.cpp @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) app.installTranslator(&qtTranslator); QTranslator aTranslator; - aTranslator.load(":/translations/android-file-transfer-linux_" + QLocale::system().name()); + aTranslator.load(":/android-file-transfer-linux_" + QLocale::system().name()); app.installTranslator(&aTranslator); MainWindow w; diff --git a/qt/translations/android-file-transfer-linux_cs.qm b/qt/translations/android-file-transfer-linux_cs.qm deleted file mode 100644 index 2fece6be6bc3f8e14be551f97c3e2cfdc1bedbf9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11520 zcmd^FYiu0Xb-qhdl(=4rvMd>@rO4N+M3Xd4Rf27_L|~O7^`IqEGAYTG&_`x>?~?SJ?0fBcCz@7wwMhhF~bKOYjJ z=NTdTeqV^Y25|iZuH!;H_L>lz=Y^PmUWgrkCi=d7Sn$8%D~}4Xu_8vF{v#oJd&TIt z_Tu^#F}bleqHaW*DH|wTfLWezA40>-|V~kOIL;1wWsg%&;5rG zgCn?t@8J2q&wspt>+j;a4%gRk?Z}${AdU4&0*P(~Km)Cv$VaUB_u7Ah27qP#$`*;4zry=i-{zHS%;jWML zPn~-K`%?Yi82c{tu&e*O_x?5Heyaan>mBIz%=(vy&InPuvi{BA*)GI=Kicr@J>SMY z7B>9e3+IHm|N4e6{`L=X|K$zed>8Bc_74227YMPff1uqS#dTrenfEVaeQDtJ2Oa_c z{l(FJcyIkrieLHOKL|1O**o^U1vz$n=ZJX3 zSFPvcDbH~%x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gxOo*Q4Wghk<%gdNiW|R$6;ulv4H4t1d8Gi!L)7)KUxDcRZ16smW8%{mk!#> zptBEZnRH6k>8z}fD|9iz8qW7Iq}& z8=Uhr{eM2F5!7zv(-p!ApSvPHk)PL)?(*EDFsy;7+vC;h+>frrwgWORATU!PR~Y=Z*+pKY^N^4c9}CV6m}l7v%#Vl@Ohd< zOwnfXW($Uf05lm)@hF=%lli9x-RA@;p6^DQ4U7d*)1cZh<0g@|9eZ&}XOxClsjKRE z4BWPG09L7MSk@e4%`2kzaI%W$0?KG12l+Aq`W1%Qe3#Rs2~W`dD9G3YnvRNqW#=?~ z_eq@e7%UBJYPOGF0nlq++-=4{%>yH&$LvVGVO|Z@kY<+hmhHr%sy2c_WKHLF!^zXU za(Fzq=E>6rShMrUy&no{`MILf^sF1?cq!`j=CJb^|4-A-;KGu(B2O>1oU)5to*QyM zcPnbpui-|lsGd0_AL*jb=EQaw+HwUaK4@Q-!PF|}AHP3|@Z;RZbjg!GcJu76f9$GY`X$!4ge@&?K4Yk=pyJz2I6n??;jQ{0!T5bX`cPuy1G8|5P0_;sGrHl-^QP_D1=z_Xw8Qft zCrNH4vsg~@XGD18hPwa2wWa=&btBbh)bF`*a(!36(Av9<))3~11 z{Xl#Ud_xOVV7r?I-mFY(8`r0J47T9Sgf-$L#?JHX?1*nNsX=iK7!YW>{J9WK>YzGV zam$=|O${p5hsEd3v}Zt77K->350S@#jiKA{*=z zL87cp3r(e}+>bn3-lx<1rWlLM{2c6NB#*C6^7v0la&~Q!vo|5x4U(t1GwNNEZAaOw z19r^Y_bq=0S2Dkw%BX5j{!gu7W!7}!AHZl5K{lH8@?`k}&R3bwIw?MbJN<>i`+Yrq F{{?R-OA`P9 diff --git a/qt/translations/android-file-transfer-linux_ru.qm b/qt/translations/android-file-transfer-linux_ru.qm deleted file mode 100644 index 71913bedb7f51daa1a6fc85058d015d0776db222..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4440 zcmb7HYiv|y8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NCaPpVkX@24V5qiCfG z=<~jD#pS!9%W+3DiMV>>HUI~!AIKa?&NuS%YZ?@dYH_3f(xBAl1>Ig4^j0~m%}wc2 zGp)i&v})eAGP>h%PKpla+9H^(zpHF z{OTkknCuRU0R*z__!x+uH46Un8^th!(axOjITIMLZOg8ZUr_uj20NA#=&BGv)1^V< z+z_c!ZY(~sT|bMG+9}&WX3(VO&r_V`D42~Tw%fjC#n(l3JDn5 z=~b0mEsNW(SGmxK8sZM&qY~BX8MU61nRS~mYw3fi>jpOh2Kt#JOdB9{K83RKG@Ax!M+YyJzOe~I}u*H>hf+xi1Wf4tQ!^* zS9?&(JkPmrQ;2}e8I_(Y&QWoRVfTIWjDRDbF~Mw#Pu!_-NZq%q1C=?-<+yewIX_u; zi38#g@Hm5eu&Nwl-GnF1KWrzXvESu*Y8u6xcp00RrI(U3-+995X;0dQv~DKGBIU=SI{*&h{2ah zVk!`wFw8v!c9%-YJz*2Qjbo<>ys6mEol27Vp6ny=gh{^c@tAzU5*_*n!nTZyK%7+ zQp}$fBQO(3o!7n*7eXd-Q^nZ|6Tv&u2grY#Z*ZZ!j}bq#WN8FsYHdfPxH7>r_;)F{ zGKurGT$)x$dZx=07!@^)jM|h{RFz|SS?0M#`WY~$(#vdL+5QrPkQ9w#6_U9HYqQt_ zx%)&jepln}9?^trZkAPeyGE=l8=2N8ayeP*4M%QI9vwQ|Dw6}p6O#jKdTJak + + ${QM_FILES_XML} + + diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 5f61fa81..0f42743b 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -63,6 +63,8 @@ build-packages: - qt5-default + - qttools5-dev + - qttools5-dev-tools - libfuse-dev - libmagic-dev - libtag1-dev