forked from blue/squawk
Minor changes
This commit is contained in:
parent
066ab487fc
commit
c147e02187
6 changed files with 19 additions and 14 deletions
|
@ -64,9 +64,14 @@ Root::~Root() {
|
|||
delete global;
|
||||
}
|
||||
|
||||
|
||||
void Root::initializeTranslation() {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
bool defaultLoaded = defaultTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::path(QLibraryInfo::TranslationsPath));
|
||||
if (!defaultLoaded)
|
||||
qDebug() << "Couldn't load default translation";
|
||||
#else
|
||||
defaultTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
#endif
|
||||
installTranslator(&defaultTranslator);
|
||||
|
||||
QStringList shares = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
|
||||
|
@ -78,15 +83,17 @@ void Root::initializeTranslation() {
|
|||
}
|
||||
|
||||
if (!found)
|
||||
currentTranslator.load(QLocale(), QLatin1String("squawk"), ".", QCoreApplication::applicationDirPath());
|
||||
found = currentTranslator.load(QLocale(), QLatin1String("squawk"), ".", QCoreApplication::applicationDirPath());
|
||||
|
||||
|
||||
installTranslator(¤tTranslator);
|
||||
if (found)
|
||||
installTranslator(¤tTranslator);
|
||||
else
|
||||
qDebug() << "Couldn't load current translation";
|
||||
}
|
||||
|
||||
void Root::initializeAppIcon() {
|
||||
for (std::vector<unsigned int>::size_type i = 0; i < appIconSizes.size(); ++i)
|
||||
appIcon.addFile(":images/logo.svg", QSize(appIconSizes[i], appIconSizes[i]));
|
||||
for (unsigned int appIconSize : appIconSizes)
|
||||
appIcon.addFile(":images/logo.svg", QSize(appIconSize, appIconSize));
|
||||
|
||||
Root::setWindowIcon(appIcon);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue