diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-04-29 18:00:13 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-05-14 07:51:20 +0200 |
commit | 2b8863a98c912806fd4e47bd2f2a6d81ec1d71b9 (patch) | |
tree | d0d03d309719486805cb81459401fe71aaec45c0 /src/xml | |
parent | ada608d46d7ab99b787e48003f8c94c1a11dab19 (diff) |
Get rid of some QTextCodec leftovers
There's no real dependency to QTextCodec in those files anymore.
Change-Id: Ifaf19ab554fd108fa26095db4e2bd4a3e9ea427f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/xml')
-rw-r--r-- | src/xml/dom/qdom.cpp | 9 | ||||
-rw-r--r-- | src/xml/sax/qxml.cpp | 11 |
2 files changed, 2 insertions, 18 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index c09770db82..0f3e381859 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -52,9 +52,6 @@ #if QT_CONFIG(regularexpression) #include <qregularexpression.h> #endif -#if QT_CONFIG(textcodec) -#include <qtextcodec.h> -#endif #include <qtextstream.h> #include <qxml.h> #include <qvariant.h> @@ -5942,7 +5939,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod const QDomNodePrivate* n = first; if(encUsed == QDomNode::EncodingFromDocument) { -#if QT_CONFIG(textcodec) && QT_CONFIG(regularexpression) +#if QT_CONFIG(regularexpression) const QDomNodePrivate* n = first; if (n && n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) { @@ -5977,11 +5974,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod else { // Write out the XML declaration. -#if !QT_CONFIG(textcodec) - const QLatin1String codecName("UTF-8"); -#else const QByteArray codecName = QStringConverter::nameForEncoding(s.encoding()); -#endif s << "<?xml version=\"1.0\" encoding=\"" << codecName diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index e98c86979b..1898f4fbe8 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -39,10 +39,8 @@ #include "qxml.h" #include "qxml_p.h" -#if QT_CONFIG(textcodec) -#include "qtextcodec.h" -#endif #include "qbuffer.h" +#include "qstringconverter.h" #if QT_CONFIG(regularexpression) #include "qregularexpression.h" #endif @@ -1301,7 +1299,6 @@ void QXmlInputSource::fetchData() } } -#if QT_CONFIG(textcodec) static QString extractEncodingDecl(const QString &text, bool *needMoreText) { *needMoreText = false; @@ -1343,7 +1340,6 @@ static QString extractEncodingDecl(const QString &text, bool *needMoreText) return encoding; } -#endif // textcodec /*! This function reads the XML file from \a data and tries to @@ -1358,10 +1354,6 @@ static QString extractEncodingDecl(const QString &text, bool *needMoreText) */ QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning) { -#if !QT_CONFIG(textcodec) - Q_UNUSED(beginning); - return QString::fromLatin1(data.constData(), data.size()); -#else if (data.size() == 0) return QString(); if (beginning) { @@ -1443,7 +1435,6 @@ QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning) } return input; -#endif } |