diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-06-21 13:39:26 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-06-21 13:39:26 +0200 |
commit | ad73447dc2bd04120c4eb7f5757613ad35a35cf5 (patch) | |
tree | f030a88726861aefbdcd185659d756e24d84fafe | |
parent | 3f51d0b8b2b2fabf5e305bd71226a8e3e5f3ad2d (diff) |
qt6: Do not use deprecated `QLibraryInfo::path` in Qt 6
See https://doc.qt.io/qt-6/qtcore-changes-qt6.html#other-classes
-rw-r--r-- | src/qt/bitcoin.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index c20a1dda97..654fb5bc4f 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -139,12 +139,17 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans // - First load the translator for the base language, without territory // - Then load the more specific locale translator +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + const QString translation_path{QLibraryInfo::location(QLibraryInfo::TranslationsPath)}; +#else + const QString translation_path{QLibraryInfo::path(QLibraryInfo::TranslationsPath)}; +#endif // Load e.g. qt_de.qm - if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (qtTranslatorBase.load("qt_" + lang, translation_path)) QApplication::installTranslator(&qtTranslatorBase); // Load e.g. qt_de_DE.qm - if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (qtTranslator.load("qt_" + lang_territory, translation_path)) QApplication::installTranslator(&qtTranslator); // Load e.g. bitcoin_de.qm (shortcut "de" needs to be defined in bitcoin.qrc) |