summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlocale.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-01-28 01:00:09 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2020-01-28 16:02:04 +0100
commit6c3eb39832876a65291546476b92fd94950b1208 (patch)
tree2d551aab7fce80b2ef603f1cfc42bf6f9d0e4411 /src/corelib/text/qlocale.cpp
parentfcd3a20059d0c629d972ba2577694394b438a100 (diff)
parent082faeff9c4c5a5b10d140b391d30305575a898b (diff)
Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"
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
{