diff options
author | Liang Qi <liang.qi@qt.io> | 2018-10-02 12:59:24 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-07 13:19:54 +0000 |
commit | 825f98815683faea06144ab0262129b0367798ee (patch) | |
tree | 48b10de0d86c6312d07700eb4e690dbd87ab8db0 /src/xml/dom/qdom.cpp | |
parent | b5d249f9538bf3dc44f11879c2244deb5a37bf97 (diff) |
Modernize the "textcodec" feature
Also clean up QTextCodec usage in qmake build and some includes
of qtextcodec.h.
Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/xml/dom/qdom.cpp')
-rw-r--r-- | src/xml/dom/qdom.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 91796106a2..5893d8448e 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -49,7 +49,9 @@ #include <qiodevice.h> #include <qlist.h> #include <qregexp.h> +#if QT_CONFIG(textcodec) #include <qtextcodec.h> +#endif #include <qtextstream.h> #include <qxml.h> #include "private/qxml_p.h" @@ -4149,7 +4151,7 @@ static QString encodeText(const QString &str, const bool performAVN = false, const bool encodeEOLs = false) { -#ifdef QT_NO_TEXTCODEC +#if !QT_CONFIG(textcodec) Q_UNUSED(s); #else const QTextCodec *const codec = s.codec(); @@ -4191,7 +4193,7 @@ static QString encodeText(const QString &str, len += 4; i += 5; } else { -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) if(codec->canEncode(ati)) ++i; else @@ -6428,7 +6430,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod const QDomNodePrivate* n = first; if(encUsed == QDomNode::EncodingFromDocument) { -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) const QDomNodePrivate* n = first; QTextCodec *codec = 0; @@ -6464,7 +6466,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod else { // Write out the XML declaration. -#ifdef QT_NO_TEXTCODEC +#if !QT_CONFIG(textcodec) const QLatin1String codecName("iso-8859-1"); #else const QTextCodec *const codec = s.codec(); |