From 825f98815683faea06144ab0262129b0367798ee Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 2 Oct 2018 12:59:24 +0200 Subject: 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 Reviewed-by: Oswald Buddenhagen --- qmake/library/qmakevfs.cpp | 8 ++++---- qmake/library/qmakevfs.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'qmake/library') diff --git a/qmake/library/qmakevfs.cpp b/qmake/library/qmakevfs.cpp index 2239a2beec..265f1e60d3 100644 --- a/qmake/library/qmakevfs.cpp +++ b/qmake/library/qmakevfs.cpp @@ -35,7 +35,7 @@ using namespace QMakeInternal; #include #include -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) #include #endif @@ -49,7 +49,7 @@ QMakeVfs::QMakeVfs() , m_magicExisting(fL1S("existing")) #endif { -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) m_textCodec = 0; #endif } @@ -219,7 +219,7 @@ QMakeVfs::ReadResult QMakeVfs::readFile(int id, QString *contents, QString *errS return ReadOtherError; } *contents = -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) m_textCodec ? m_textCodec->toUnicode(bcont) : #endif QString::fromLocal8Bit(bcont); @@ -273,7 +273,7 @@ void QMakeVfs::invalidateContents() } #endif -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) void QMakeVfs::setTextCodec(const QTextCodec *textCodec) { m_textCodec = textCodec; diff --git a/qmake/library/qmakevfs.h b/qmake/library/qmakevfs.h index 1217225471..7d4f9bb890 100644 --- a/qmake/library/qmakevfs.h +++ b/qmake/library/qmakevfs.h @@ -38,7 +38,7 @@ # include #endif -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) QT_FORWARD_DECLARE_CLASS(QTextCodec) #endif @@ -89,7 +89,7 @@ public: void invalidateContents(); #endif -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) void setTextCodec(const QTextCodec *textCodec); #endif @@ -125,7 +125,7 @@ private: QString m_magicMissing; QString m_magicExisting; #endif -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) const QTextCodec *m_textCodec; #endif }; -- cgit v1.2.3