summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativexmlhttprequest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qdeclarativexmlhttprequest.cpp')
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
index acd1f51..ff1a0e9 100644
--- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp
+++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
@@ -58,6 +58,8 @@
#include <QtCore/qstack.h>
#include <QtCore/qdebug.h>
+#ifndef QT_NO_XMLSTREAMREADER
+
// From DOM-Level-3-Core spec
// http://www.w3.org/TR/DOM-Level-3-Core/core.html
#define INDEX_SIZE_ERR 1
@@ -1304,10 +1306,11 @@ QString QDeclarativeXMLHttpRequest::responseBody() const
{
QXmlStreamReader reader(m_responseEntityBody);
reader.readNext();
+#ifndef QT_NO_TEXTCODEC
QTextCodec *codec = QTextCodec::codecForName(reader.documentEncoding().toString().toUtf8());
if (codec)
return codec->toUnicode(m_responseEntityBody);
-
+#endif
return QString::fromUtf8(m_responseEntityBody);
}
@@ -1662,4 +1665,6 @@ void qt_add_qmlxmlhttprequest(QScriptEngine *engine)
QT_END_NAMESPACE
+#endif // QT_NO_XMLSTREAMREADER
+
#include <qdeclarativexmlhttprequest.moc>