summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
-rw-r--r--src/corelib/text/qlocale.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
index fb45b82967..6dbec8ba33 100644
--- a/src/corelib/text/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -734,23 +734,23 @@ static void updateSystemPrivate()
globalLocaleData.m_script_id = res.toInt();
res = sys_locale->query(QSystemLocale::DecimalPoint, QVariant());
- if (!res.isNull())
+ if (!res.isNull() && !res.toString().isEmpty())
globalLocaleData.m_decimal = res.toString().at(0).unicode();
res = sys_locale->query(QSystemLocale::GroupSeparator, QVariant());
- if (!res.isNull())
+ if (!res.isNull() && !res.toString().isEmpty())
globalLocaleData.m_group = res.toString().at(0).unicode();
res = sys_locale->query(QSystemLocale::ZeroDigit, QVariant());
- if (!res.isNull())
+ if (!res.isNull() && !res.toString().isEmpty())
globalLocaleData.m_zero = res.toString().at(0).unicode();
res = sys_locale->query(QSystemLocale::NegativeSign, QVariant());
- if (!res.isNull())
+ if (!res.isNull() && !res.toString().isEmpty())
globalLocaleData.m_minus = res.toString().at(0).unicode();
res = sys_locale->query(QSystemLocale::PositiveSign, QVariant());
- if (!res.isNull())
+ if (!res.isNull() && !res.toString().isEmpty())
globalLocaleData.m_plus = res.toString().at(0).unicode();
}
#endif // !QT_NO_SYSTEMLOCALE
@@ -4463,6 +4463,8 @@ QStringList QLocale::uiLanguages() const
for (const auto entry : qAsConst(uiLanguages))
locales.append(QLocale(entry));
}
+ if (locales.isEmpty())
+ locales.append(systemLocale()->fallbackUiLocale());
} else
#endif
{