summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-03-07 13:18:52 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-03-07 13:18:52 (GMT)
commite5deaaa6ab843913bdf3ade47611f61f968db130 (patch)
tree59d0e40f3342553052425d74e690f15e03df7b8e /src/corelib/tools/qlocale.cpp
parent2b12529253add5c6e9095474e2030576176c1f31 (diff)
downloadQt-e5deaaa6ab843913bdf3ade47611f61f968db130.zip
Qt-e5deaaa6ab843913bdf3ade47611f61f968db130.tar.gz
Qt-e5deaaa6ab843913bdf3ade47611f61f968db130.tar.bz2
Improved QLocale::quoteString.
Whenever the system locale doesn't return the proper alternate quotes we should try the standard quotes before falling back to the CLDR data. Reviewed-by: trustme
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r--src/corelib/tools/qlocale.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 5b25c97..4c0b154 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -803,11 +803,10 @@ QString QLocale::quoteString(const QStringRef &str, QuotationStyle style) const
#ifndef QT_NO_SYSTEMLOCALE
if (d() == systemPrivate()) {
QVariant res;
- if (style == QLocale::StandardQuotation)
- res = systemLocale()->query(QSystemLocale::StringToStandardQuotation, QVariant::fromValue(str));
- else
+ if (style == QLocale::AlternateQuotation)
res = systemLocale()->query(QSystemLocale::StringToAlternateQuotation, QVariant::fromValue(str));
-
+ if (res.isNull() || style == QLocale::StandardQuotation)
+ res = systemLocale()->query(QSystemLocale::StringToStandardQuotation, QVariant::fromValue(str));
if (!res.isNull())
return res.toString();
}