Problem was that QSetting were initialized before application/organization name is set
This commit is contained in:
a1ext 2018-11-02 19:49:15 +03:00 committed by Itay Cohen
parent 84b70215ce
commit 313e8b17cd

View File

@ -24,6 +24,14 @@
CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc, argv)
{
// Setup application information
setOrganizationName("Cutter");
setApplicationName("Cutter");
setApplicationVersion(CUTTER_VERSION_FULL);
setWindowIcon(QIcon(":/img/cutter.svg"));
setAttribute(Qt::AA_DontShowIconsInMenus);
// WARN!!! Put initialization code below this line. Code above this line is mandatory to be run First
// Load translations
QTranslator *t = new QTranslator;
QTranslator *qtBaseTranslator = new QTranslator;
@ -37,10 +45,12 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
for (auto &it : allLocales) {
langPrefix = it.bcp47Name();
if (langPrefix == language) {
t->load(QString(QCoreApplication::applicationDirPath() + QDir::separator() +
"translations" + QDir::separator() +
"cutter_%1.qm").arg(langPrefix));
const QString &cutterTranslationPath = QCoreApplication::applicationDirPath() + QDir::separator()
+ "translations" + QDir::separator() + QString("cutter_%1.qm").arg(langPrefix);
if (t->load(cutterTranslationPath)) {
installTranslator(t);
}
QApplication::setLayoutDirection(it.textDirection());
QLocale::setDefault(it);
@ -62,13 +72,6 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
}
}
// Setup application information
setOrganizationName("Cutter");
setApplicationName("Cutter");
setApplicationVersion(CUTTER_VERSION_FULL);
setWindowIcon(QIcon(":/img/cutter.svg"));
setAttribute(Qt::AA_DontShowIconsInMenus);
// Load fonts
int ret = QFontDatabase::addApplicationFont(":/fonts/Anonymous Pro.ttf");
if (ret == -1) {