Set default lang only if index received
This commit is contained in:
parent
b9beb3c7d2
commit
83e1dd285a
@ -169,10 +169,22 @@ TranslationsModel::~TranslationsModel()
|
|||||||
void TranslationsModel::translationDirChanged(const QString& path)
|
void TranslationsModel::translationDirChanged(const QString& path)
|
||||||
{
|
{
|
||||||
qDebug() << "Dir changed:" << path;
|
qDebug() << "Dir changed:" << path;
|
||||||
|
if (!d->no_language_set)
|
||||||
|
{
|
||||||
reloadLocalFiles();
|
reloadLocalFiles();
|
||||||
|
}
|
||||||
|
selectLanguage(selectedLanguage());
|
||||||
|
}
|
||||||
|
|
||||||
|
void TranslationsModel::indexReceived()
|
||||||
|
{
|
||||||
|
qDebug() << "Got translations index!";
|
||||||
|
d->m_index_job.reset();
|
||||||
|
|
||||||
if (d->no_language_set)
|
if (d->no_language_set)
|
||||||
{
|
{
|
||||||
|
reloadLocalFiles();
|
||||||
|
|
||||||
auto language = d->m_system_locale;
|
auto language = d->m_system_locale;
|
||||||
if (!findLanguage(language))
|
if (!findLanguage(language))
|
||||||
{
|
{
|
||||||
@ -186,17 +198,8 @@ void TranslationsModel::translationDirChanged(const QString& path)
|
|||||||
APPLICATION->settings()->set("Language", selectedLanguage());
|
APPLICATION->settings()->set("Language", selectedLanguage());
|
||||||
d->no_language_set = false;
|
d->no_language_set = false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
selectLanguage(selectedLanguage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TranslationsModel::indexReceived()
|
else if(d->m_selectedLanguage != defaultLangCode)
|
||||||
{
|
|
||||||
qDebug() << "Got translations index!";
|
|
||||||
d->m_index_job.reset();
|
|
||||||
if(d->m_selectedLanguage != defaultLangCode)
|
|
||||||
{
|
{
|
||||||
downloadTranslation(d->m_selectedLanguage);
|
downloadTranslation(d->m_selectedLanguage);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user