Load default codecs even if custom QTextCodec has been registered
Task-number: QTBUG-40378 Change-Id: I33f1e92127972e1346993aa4e07731bf4b697667 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
parent
c9b49612ff
commit
51ec20d93e
@ -253,9 +253,10 @@ static QTextCodec *setupLocaleMapper()
|
||||
// textCodecsMutex need to be locked to enter this function
|
||||
static void setup()
|
||||
{
|
||||
QCoreGlobalData *globalData = QCoreGlobalData::instance();
|
||||
if (!globalData->allCodecs.isEmpty())
|
||||
static bool initialized = false;
|
||||
if (initialized)
|
||||
return;
|
||||
initialized = true;
|
||||
|
||||
#if !defined(QT_NO_CODECS) && !defined(QT_BOOTSTRAPPED)
|
||||
(void)new QTsciiCodec;
|
||||
@ -465,7 +466,11 @@ QTextCodec::QTextCodec()
|
||||
{
|
||||
QMutexLocker locker(textCodecsMutex());
|
||||
|
||||
QCoreGlobalData::instance()->allCodecs.prepend(this);
|
||||
QCoreGlobalData *globalInstance = QCoreGlobalData::instance();
|
||||
if (globalInstance->allCodecs.isEmpty())
|
||||
setup();
|
||||
|
||||
globalInstance->allCodecs.prepend(this);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user