summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2018-09-03 11:24:55 +0200
committerSimon Rettberg2018-09-03 11:24:55 +0200
commit1b854f59cecbea99fc379f9ff72e494848a13928 (patch)
tree7d5707a77499a2a7a3cc958e04a84d4c3a5aeb86
parent[client] Switch back to first desktop when hiding manager toggle button (diff)
downloadpvs2-1b854f59cecbea99fc379f9ff72e494848a13928.tar.gz
pvs2-1b854f59cecbea99fc379f9ff72e494848a13928.tar.xz
pvs2-1b854f59cecbea99fc379f9ff72e494848a13928.zip
[*] Add log message if loading translations fails
-rw-r--r--src/client/clientapp/clientapp.cpp14
-rw-r--r--src/server/serverapp/serverapp.cpp14
2 files changed, 20 insertions, 8 deletions
diff --git a/src/client/clientapp/clientapp.cpp b/src/client/clientapp/clientapp.cpp
index 962ec42..2447526 100644
--- a/src/client/clientapp/clientapp.cpp
+++ b/src/client/clientapp/clientapp.cpp
@@ -22,12 +22,18 @@ ClientApp::ClientApp(int& argc, char** argv)
/* set translator */
// System strings
QTranslator *qtTranslator = new QTranslator(this);
- qtTranslator->load(QLocale::system(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath));
- installTranslator(qtTranslator);
+ if (!qtTranslator->load(QLocale::system(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
+ qDebug() << "Could not load system string translations";
+ } else {
+ installTranslator(qtTranslator);
+ }
// App specific
QTranslator *translator = new QTranslator(this);
- translator->load(QLocale::system(), ":", "l_");
- installTranslator(translator);
+ if (!translator->load(QLocale::system(), ":", "l_")) {
+ qDebug() << "Could not load app translations";
+ } else {
+ installTranslator(translator);
+ }
readIsManagerPc();
diff --git a/src/server/serverapp/serverapp.cpp b/src/server/serverapp/serverapp.cpp
index f680f89..2cc237a 100644
--- a/src/server/serverapp/serverapp.cpp
+++ b/src/server/serverapp/serverapp.cpp
@@ -28,12 +28,18 @@ ServerApp::ServerApp(int& argc, char** argv)
// System strings
QTranslator *qtTranslator = new QTranslator(this);
- qtTranslator->load(QLocale::system(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath));
- installTranslator(qtTranslator);
+ if (!qtTranslator->load(QLocale::system(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
+ qDebug() << "Loading system translations failed" << QLibraryInfo::location(QLibraryInfo::TranslationsPath);
+ } else {
+ installTranslator(qtTranslator);
+ }
// App specific
QTranslator *translator = new QTranslator(this);
- translator->load(QLocale::system(), ":", "l_");
- installTranslator(translator);
+ if (!translator->load(QLocale::system(), ":", "l_")) {
+ qDebug() << "Loading app translations failed";
+ } else {
+ installTranslator(translator);
+ }
/* Set the global path of the settings */
QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, "/opt/");