diff options
author | Zeno Albisser <zeno.albisser@nokia.com> | 2011-02-25 14:42:51 (GMT) |
---|---|---|
committer | Zeno Albisser <zeno.albisser@nokia.com> | 2011-02-25 15:05:50 (GMT) |
commit | 08868df5e94a5b89d9f8ce904e97b43a48313fc1 (patch) | |
tree | e698bd1615ceab3456a17224161fa9965c9c2392 /src/corelib/tools/qlocale.cpp | |
parent | 4b09e9cbfce4df05f187e6f399738219d3f2853e (diff) | |
download | Qt-08868df5e94a5b89d9f8ce904e97b43a48313fc1.zip Qt-08868df5e94a5b89d9f8ce904e97b43a48313fc1.tar.gz Qt-08868df5e94a5b89d9f8ce904e97b43a48313fc1.tar.bz2 |
fixed QLocale::quoteString() to allow for QSystemLocale implementation
Reviewed-by: Denis Dzyubenko
Task-number: QTBUG-17096
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index e10ca8a..5027d00 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -651,7 +651,6 @@ QLocale::NumberOptions QLocale::numberOptions() const */ QString QLocale::quoteString(const QString &str, QuotationStyle qs) const { - return quoteString(&str, qs); } @@ -664,14 +663,18 @@ QString QLocale::quoteString(const QStringRef &str, QuotationStyle qs) const { #ifndef QT_NO_SYSTEMLOCALE if (d() == systemPrivate()) { - QVariant quotationBegin = systemLocale()->query(QSystemLocale::QuotationBegin, QVariant(qs)); - QVariant quotationEnd = systemLocale()->query(QSystemLocale::QuotationEnd, QVariant(qs)); - if (!quotationBegin.isNull() && !quotationEnd.isNull()) - return quotationBegin.toString() % str % quotationEnd.toString(); + QVariant res; + if (qs == QLocale::StandardQuotation) + res = systemLocale()->query(QSystemLocale::StringToStandardQuotation, QVariant::fromValue(str)); + else + res = systemLocale()->query(QSystemLocale::StringToAlternateQuotation, QVariant::fromValue(str)); + + if (!res.isNull()) + return res.toString(); } #endif - if (qs == StandardQuotation) + if (qs == QLocale::StandardQuotation) return QChar(d()->m_quotation_start) % str % QChar(d()->m_quotation_end); else return QChar(d()->m_alternate_quotation_start) % str % QChar(d()->m_alternate_quotation_end); |