[Pkg-owncloud-commits] [owncloud-client] 14/20: Second part of #1661

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Oct 24 20:08:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch sid
in repository owncloud-client.

commit f1dbba9e5a31ebaa02e78ca2092b9e1ba8ca47e8
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Wed Oct 15 17:10:41 2014 +0200

    Second part of #1661
    
    - QT_INSTALL_TRANSLATIONS was not defined in Qt5
    - Some languages have been split up in multiple qm's. We only need qtbase for now
---
 cmake/modules/NSIS.template.in |  2 ++
 src/CMakeLists.txt             |  8 +++++++-
 src/mirall/application.cpp     | 11 +++++++----
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/cmake/modules/NSIS.template.in b/cmake/modules/NSIS.template.in
index 5b92ee1..9e0e54a 100644
--- a/cmake/modules/NSIS.template.in
+++ b/cmake/modules/NSIS.template.in
@@ -378,6 +378,8 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
    ; Make sure only to copy qt, not qt_help, etc
    File "${MING_SHARE}\qt5\translations\qt_??.qm"
    File "${MING_SHARE}\qt5\translations\qt_??_??.qm"
+   File "${MING_SHARE}\qt5\translations\qtbase_??.qm"
+   File "${MING_SHARE}\qt5\translations\qtbase_??_??.qm"
    File "${MING_SHARE}\qt5\translations\qtkeychain_*.qm"
 
    SetOutPath "$INSTDIR\platforms"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e09169c..1727a17 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -390,7 +390,6 @@ set(ownCloud ${ownCloud_old})
 if (WITH_DBUS)
     set(ADDITIONAL_APP_MODULES DBus)
 endif(WITH_DBUS)
-
 if(NOT BUILD_OWNCLOUD_OSX_BUNDLE AND NOT BUILD_LIBRARIES_ONLY)
     set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
 
@@ -427,8 +426,15 @@ elseif(NOT BUILD_LIBRARIES_ONLY)
 
     set (QM_DIR ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/Translations)
     install(FILES ${mirall_I18N} DESTINATION ${QM_DIR})
+    get_target_property(_qmake Qt5::qmake LOCATION)
+    execute_process(COMMAND ${_qmake} -query QT_INSTALL_TRANSLATIONS
+        OUTPUT_VARIABLE QT_TRANSLATIONS_DIR
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
     file(GLOB qt_I18N ${QT_TRANSLATIONS_DIR}/qt_??.qm ${QT_TRANSLATIONS_DIR}/qt_??_??.qm)
     install(FILES ${qt_I18N} DESTINATION ${QM_DIR})
+    file(GLOB qtbase_I18N ${QT_TRANSLATIONS_DIR}/qtbase_??.qm ${QT_TRANSLATIONS_DIR}/qt_??_??.qm)
+    install(FILES ${qtbase_I18N} DESTINATION ${QM_DIR})
     file(GLOB qtkeychain_I18N ${QT_TRANSLATIONS_DIR}/qtkeychain*.qm)
     install(FILES ${qtkeychain_I18N} DESTINATION ${QM_DIR})
 endif()
diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp
index 9558f5d..eb739e2 100644
--- a/src/mirall/application.cpp
+++ b/src/mirall/application.cpp
@@ -532,12 +532,15 @@ void Application::setupTranslations()
             setProperty("ui_lang", lang);
             const QString qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
             const QString qtTrFile = QLatin1String("qt_") + lang;
+            const QString qtBaseTrFile = QLatin1String("qtbase_") + lang;
             if (!qtTranslator->load(qtTrFile, qtTrPath)) {
-                qtTranslator->load(qtTrFile, trPath);
+                if (!qtTranslator->load(qtTrFile, trPath)) {
+                    qtTranslator->load(qtBaseTrFile, trPath);
+                }
             }
-            const QString qtkeychainFile = QLatin1String("qt_") + lang;
-            if (!qtkeychainTranslator->load(qtkeychainFile, qtTrPath)) {
-               qtkeychainTranslator->load(qtkeychainFile, trPath);
+            const QString qtkeychainTrFile = QLatin1String("qtkeychain_") + lang;
+            if (!qtkeychainTranslator->load(qtkeychainTrFile, qtTrPath)) {
+                qtkeychainTranslator->load(qtkeychainTrFile, trPath);
             }
             if (!translator->isEmpty())
                 installTranslator(translator);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list