mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 02:15:36 -04:00
[welcome] Avoid crash when no Branding available
- don't install translators twice -- do it in setLocaleIndex only - avoid crash if the branding instance is nullptr
This commit is contained in:
parent
38c65e80f3
commit
e9a98f35ad
1 changed files with 2 additions and 3 deletions
|
@ -152,8 +152,6 @@ Config::initLanguages()
|
||||||
{
|
{
|
||||||
QString name = m_languages->locale( matchedLocaleIndex ).name();
|
QString name = m_languages->locale( matchedLocaleIndex ).name();
|
||||||
cDebug() << Logger::SubEntry << "Matched with index" << matchedLocaleIndex << name;
|
cDebug() << Logger::SubEntry << "Matched with index" << matchedLocaleIndex << name;
|
||||||
|
|
||||||
CalamaresUtils::installTranslator( name, Calamares::Branding::instance()->translationsDirectory() );
|
|
||||||
setLocaleIndex( matchedLocaleIndex );
|
setLocaleIndex( matchedLocaleIndex );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -192,7 +190,8 @@ Config::setLocaleIndex( int index )
|
||||||
cDebug() << "Index" << index << "Selected locale" << selectedLocale;
|
cDebug() << "Index" << index << "Selected locale" << selectedLocale;
|
||||||
|
|
||||||
QLocale::setDefault( selectedLocale );
|
QLocale::setDefault( selectedLocale );
|
||||||
CalamaresUtils::installTranslator( selectedLocale, Calamares::Branding::instance()->translationsDirectory() );
|
const auto* branding = Calamares::Branding::instance();
|
||||||
|
CalamaresUtils::installTranslator( selectedLocale, branding ? branding->translationsDirectory() : QString() );
|
||||||
if ( Calamares::JobQueue::instance() && Calamares::JobQueue::instance()->globalStorage() )
|
if ( Calamares::JobQueue::instance() && Calamares::JobQueue::instance()->globalStorage() )
|
||||||
{
|
{
|
||||||
CalamaresUtils::Locale::insertGS( *Calamares::JobQueue::instance()->globalStorage(),
|
CalamaresUtils::Locale::insertGS( *Calamares::JobQueue::instance()->globalStorage(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue