diff options
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeerror.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativescriptparser.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativexmlhttprequest.cpp | 7 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativexmlhttprequest_p.h | 4 |
5 files changed, 16 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 8eb0939..e8cb36e 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -301,7 +301,9 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr + QDir::separator() + QLatin1String("OfflineStorage"); #endif +#ifndef QT_NO_XMLSTREAMREADER qt_add_qmlxmlhttprequest(this); +#endif qt_add_qmlsqldatabase(this); // XXX A Multimedia "Qt.Sound" class also needs to be made available, // XXX but we don't want a dependency in that cirection. diff --git a/src/declarative/qml/qdeclarativeerror.cpp b/src/declarative/qml/qdeclarativeerror.cpp index 8717f56..0ab5cd9 100644 --- a/src/declarative/qml/qdeclarativeerror.cpp +++ b/src/declarative/qml/qdeclarativeerror.cpp @@ -250,7 +250,9 @@ QDebug operator<<(QDebug debug, const QDeclarativeError &error) if (f.open(QIODevice::ReadOnly)) { QByteArray data = f.readAll(); QTextStream stream(data, QIODevice::ReadOnly); +#ifndef QT_NO_TEXTCODEC stream.setCodec("UTF-8"); +#endif const QString code = stream.readAll(); const QStringList lines = code.split(QLatin1Char('\n')); diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index 4d98ca8..f703cf5 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -831,7 +831,9 @@ bool QDeclarativeScriptParser::parse(const QByteArray &qmldata, const QUrl &url) _scriptFile = fileName; QTextStream stream(qmldata, QIODevice::ReadOnly); +#ifndef QT_NO_TEXTCODEC stream.setCodec("UTF-8"); +#endif const QString code = stream.readAll(); data = new QDeclarativeScriptParserJsASTData(fileName); 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> diff --git a/src/declarative/qml/qdeclarativexmlhttprequest_p.h b/src/declarative/qml/qdeclarativexmlhttprequest_p.h index 068cd0f..f340c1c 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest_p.h +++ b/src/declarative/qml/qdeclarativexmlhttprequest_p.h @@ -56,6 +56,8 @@ #include <QtCore/qglobal.h> +#ifndef QT_NO_XMLSTREAMREADER + QT_BEGIN_NAMESPACE class QScriptEngine; @@ -63,5 +65,7 @@ void qt_add_qmlxmlhttprequest(QScriptEngine *engine); QT_END_NAMESPACE +#endif // QT_NO_XMLSTREAMREADER + #endif // QDECLARATIVEXMLHTTPREQUEST_P_H |