File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -461,15 +461,15 @@ void MainWindow::loadConfigFromFile(const QString & fileName)
461461void MainWindow::saveConfig (const QString &fileName)
462462{
463463 if (fileName.isEmpty ()) return ;
464-
464+
465465 // Create backup of existing file
466466 if (QFile::exists (fileName))
467467 {
468468 QString backupFileName = fileName + QString::fromLatin1 (" .bak" );
469469 QFile::remove (backupFileName);
470470 QFile::copy (fileName, backupFileName);
471471 }
472-
472+
473473 QFile f (fileName);
474474 if (!f.open (QIODevice::WriteOnly | QIODevice::Text ))
475475 {
@@ -947,6 +947,7 @@ void MainWindow::outputLogFinish()
947947void MainWindow::switchLanguage (QAction *action)
948948{
949949 QString langCode = action->data ().toString ();
950+ printf (" switchLanguage(%s)\n " ,qPrintable (langCode));
950951 m_translationManager->switchLanguage (langCode);
951952}
952953
Original file line number Diff line number Diff line change @@ -219,13 +219,15 @@ bool TranslationManager::switchLanguage(const QString &langCode)
219219#endif
220220 if (QFileInfo::exists (qtQmPath))
221221 {
222+ printf (" Loading %s file\n " ,qPrintable (qtQmPath));
222223 m_qtTranslator->load (qtQmPath);
223224 qApp->installTranslator (m_qtTranslator);
224225 }
225226 else
226227 {
227- delete m_qtTranslator;
228- m_qtTranslator = nullptr ;
228+ // these aren't available for a static Qt build. To be fixed.
229+ printf (" Failed to find %s file. Continuing anyway.\n " ,qPrintable (qtQmPath));
230+ qApp->installTranslator (m_qtTranslator);
229231 }
230232
231233 m_currentLangCode = langCode;
@@ -240,6 +242,7 @@ bool TranslationManager::switchLanguage(const QString &langCode)
240242void TranslationManager::switchToSystemLanguage ()
241243{
242244 QString sysLang = detectSystemLanguage ();
245+ printf (" switchToSystemLanguage(%s)\n " ,qPrintable (sysLang));
243246 switchLanguage (sysLang);
244247}
245248
You can’t perform that action at this time.
0 commit comments