mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
const-ify the private QTextCodec data pointer
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
fb0efaa977
commit
0c717a4fb8
2 changed files with 15 additions and 8 deletions
|
@ -1399,8 +1399,16 @@ Q_GLOBAL_STATIC(QTextCodecCleanup, qGlobalQTextCodec)
|
|||
/*!
|
||||
\internal
|
||||
*/
|
||||
QTextCodec::QTextCodec()
|
||||
: d_ptr(nullptr)
|
||||
QTextCodec::QTextCodec(const QByteArray &codec)
|
||||
: d_ptr(new QTextCodecPrivate(codec))
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
QTextCodec::QTextCodec(const int codec)
|
||||
: d_ptr(new QTextCodecPrivate(codec))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1447,8 +1455,7 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name)
|
|||
#ifndef QT_NO_THREAD
|
||||
QMutexLocker locker(textCodecsMutex());
|
||||
#endif
|
||||
QTextCodec* newcodec = new QTextCodec();
|
||||
newcodec->d_ptr = new QTextCodecPrivate(codec);
|
||||
QTextCodec* newcodec = new QTextCodec(codec);
|
||||
qGlobalQTextCodec()->append(newcodec);
|
||||
return newcodec;
|
||||
}
|
||||
|
@ -1481,8 +1488,7 @@ QTextCodec* QTextCodec::codecForMib(int mib)
|
|||
#ifndef QT_NO_THREAD
|
||||
QMutexLocker locker(textCodecsMutex());
|
||||
#endif
|
||||
QTextCodec* newcodec = new QTextCodec();
|
||||
newcodec->d_ptr = new QTextCodecPrivate(codec);
|
||||
QTextCodec* newcodec = new QTextCodec(codec);
|
||||
qGlobalQTextCodec()->append(newcodec);
|
||||
return newcodec;
|
||||
}
|
||||
|
|
|
@ -114,12 +114,13 @@ public:
|
|||
private:
|
||||
Q_DISABLE_COPY(QTextCodec);
|
||||
|
||||
QTextCodec();
|
||||
QTextCodec(const QByteArray &codec);
|
||||
QTextCodec(const int codec);
|
||||
~QTextCodec();
|
||||
|
||||
friend class QTextCodecCleanup;
|
||||
|
||||
QTextCodecPrivate* d_ptr;
|
||||
QTextCodecPrivate* const d_ptr;
|
||||
};
|
||||
|
||||
#endif // QT_NO_TEXTCODEC
|
||||
|
|
Loading…
Add table
Reference in a new issue