mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 11:37:56 -04:00
Make the QTranslator members of KiwixApp.
If we pass their address to `installTranslator` we have to be sure they exist after we quit the constructor.
This commit is contained in:
parent
0c6cdc4ac4
commit
2304987bcf
@ -2,7 +2,6 @@
|
||||
#include "zim/error.h"
|
||||
|
||||
#include <QLocale>
|
||||
#include <QTranslator>
|
||||
#include <QObject>
|
||||
#include <QLibraryInfo>
|
||||
#include <QFontDatabase>
|
||||
@ -16,14 +15,12 @@
|
||||
KiwixApp::KiwixApp(int& argc, char *argv[])
|
||||
: QApplication(argc, argv)
|
||||
{
|
||||
QTranslator qtTranslator;
|
||||
qtTranslator.load("qt_" + QLocale::system().name(),
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
installTranslator(&qtTranslator);
|
||||
m_qtTranslator.load("qt_" + QLocale::system().name(),
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
installTranslator(&m_qtTranslator);
|
||||
|
||||
QTranslator myappTranslator;
|
||||
myappTranslator.load(":/i18n/kiwix-desktop.qm");
|
||||
installTranslator(&myappTranslator);
|
||||
m_appTranslator.load(":/i18n/kiwix-desktop.qm");
|
||||
installTranslator(&m_appTranslator);
|
||||
|
||||
auto icon = QIcon();
|
||||
icon.addFile(":/icons/kiwix/app_icon.svg");
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QErrorMessage>
|
||||
#include <QTranslator>
|
||||
|
||||
|
||||
class KiwixApp : public QApplication
|
||||
@ -72,6 +73,7 @@ protected:
|
||||
void postInit();
|
||||
|
||||
private:
|
||||
QTranslator m_qtTranslator, m_appTranslator;
|
||||
Library m_library;
|
||||
MainWindow* mp_mainWindow;
|
||||
TabWidget* mp_tabWidget;
|
||||
|
Loading…
x
Reference in New Issue
Block a user