Skip to content

Commit 830865d

Browse files
committed
Workaround for static Qt build (not having qtbase_xx.qm)
1 parent 86ca532 commit 830865d

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

addon/doxywizard/doxywizard.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,15 +461,15 @@ void MainWindow::loadConfigFromFile(const QString & fileName)
461461
void 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()
947947
void 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

addon/doxywizard/translationmanager.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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)
240242
void TranslationManager::switchToSystemLanguage()
241243
{
242244
QString sysLang = detectSystemLanguage();
245+
printf("switchToSystemLanguage(%s)\n",qPrintable(sysLang));
243246
switchLanguage(sysLang);
244247
}
245248

0 commit comments

Comments
 (0)