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>
This commit is contained in:
Lars Knoll 2020-04-29 18:00:13 +02:00
parent ada608d46d
commit 2b8863a98c
18 changed files with 6 additions and 45 deletions

View File

@ -312,9 +312,8 @@
If we successfully opened the file, we use a QTextStream object
to read in the data. QTextStream automatically converts the 8-bit
data into a Unicode QString and supports various encodings. If no
encoding is specified, QTextStream assumes the file is written
using the system's default 8-bit encoding (for example, Latin-1;
see QTextCodec::codecForLocale() for details).
encoding is specified, QTextStream assumes the file is encoded in
UTF-8.
Since the call to QTextStream::readAll() might take some time, we
set the cursor to be Qt::WaitCursor for the entire application

View File

@ -148,7 +148,7 @@ QT_BEGIN_NAMESPACE
binary data (except for the NUL character). QProcessEnvironment will preserve
such variables, but does not support manipulating variables whose names or
values cannot be encoded by the current locale settings (see
QTextCodec::codecForLocale).
QString::toLocal8Bit).
On Windows, the variable names are case-insensitive, but case-preserving.
QProcessEnvironment behaves accordingly.

View File

@ -60,7 +60,6 @@ QT_BEGIN_NAMESPACE
class QCoreApplicationPrivate;
class QTextCodec;
class QTranslator;
class QPostEventList;
class QStringList;

View File

@ -165,7 +165,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384;
parameter: qSetFieldWidth(), qSetPadChar(), and
qSetRealNumberPrecision().
\sa QDataStream, QIODevice, QFile, QBuffer, QTcpSocket, {Text Codecs Example}
\sa QDataStream, QIODevice, QFile, QBuffer, QTcpSocket
*/
/*! \enum QTextStream::RealNumberNotation

View File

@ -55,10 +55,6 @@
QT_BEGIN_NAMESPACE
class QTextCodec;
class QTextDecoder;
class QTextStreamPrivate;
class Q_CORE_EXPORT QTextStream // text stream class
{

View File

@ -45,9 +45,6 @@
#include <qdebug.h>
#include <qfile.h>
#include <stdio.h>
#if QT_CONFIG(textcodec)
#include <qtextcodec.h>
#endif
#include <qstringconverter.h>
#include <qstack.h>
#include <qbuffer.h>

View File

@ -75,7 +75,6 @@ class QRegularExpression;
class QRegularExpressionMatch;
class QString;
class QStringList;
class QTextCodec;
class QStringRef;
template <typename T> class QVector;
@ -1021,7 +1020,6 @@ private:
static qlonglong toIntegral_helper(const QChar *data, int len, bool *ok, int base);
static qulonglong toIntegral_helper(const QChar *data, uint len, bool *ok, int base);
void replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen);
friend class QTextCodec;
friend class QStringRef;
friend class QStringView;
friend class QByteArray;

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include "qlibinputkeyboard_p.h"
#include <QtCore/QTextCodec>
#include <QtCore/QLoggingCategory>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/private/qinputdevicemanager_p.h>

View File

@ -42,7 +42,6 @@
#include <QtGui/private/qinternalmimedata_p.h>
#include <QtCore/qbytearraymatcher.h>
#include <QtCore/qtextcodec.h>
#include <QtCore/qmap.h>
#include <QtCore/qurl.h>
#include <QtCore/qdir.h>

View File

@ -48,9 +48,6 @@
#include <qsqlquery.h>
#include <qsqlrecord.h>
#include <qstringlist.h>
#if QT_CONFIG(textcodec)
#include <qtextcodec.h>
#endif
#include <qvector.h>
#include <qfile.h>
#include <qdebug.h>

View File

@ -35,7 +35,6 @@
#include <qdir.h>
#include <qhashfunctions.h>
#include <qtextstream.h>
#include <qtextcodec.h>
#include <qcoreapplication.h>
#include <qcommandlineoption.h>
#include <qcommandlineparser.h>

View File

@ -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

View File

@ -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
}

View File

@ -34,7 +34,6 @@
#include <qfile.h>
#include <qdir.h>
#include <qset.h>
#include <qtextcodec.h>
#include <QtTest/private/qtesthelpers_p.h>
#ifdef Q_OS_WIN
# include <windows.h>

View File

@ -36,7 +36,6 @@
#include <qdatetime.h>
#include <qdir.h>
#include <qset.h>
#include <qtextcodec.h>
#include <QtTest/private/qtesthelpers_p.h>

View File

@ -36,7 +36,6 @@
#include <qcoreapplication.h>
#include <qfileinfo.h>
#include <qtextcodec.h>
#include <qmap.h>
Q_DECLARE_METATYPE(QUrl::FormattingOptions)

View File

@ -33,7 +33,6 @@
#include <qdir.h>
#include <qfileinfo.h>
#include <QScopedArrayPointer>
#include <qtextcodec.h>
#include <qdatetime.h>
#if QT_CONFIG(process)
# include <qprocess.h>

View File

@ -41,7 +41,6 @@
#include <QtTest/QtTest>
#include <qregexp.h>
#include <qregularexpression.h>
#include <qtextcodec.h>
#include <qtextstream.h>
#include <qstringlist.h>
#include <qstringmatcher.h>
@ -4184,7 +4183,6 @@ void tst_QString::stringRef_utf8()
QCOMPARE( utf8, QByteArray(ref.toUtf8()) );
}
// copied to tst_QTextCodec::utf8Codec_data()
void tst_QString::fromUtf8_data()
{
QTest::addColumn<QByteArray>("utf8");