summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qtextcodec.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/codecs/qtextcodec.h')
-rw-r--r--src/corelib/codecs/qtextcodec.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index e37527d..4ba8b85 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -148,12 +148,13 @@ public:
private:
friend class QTextCodecCleanup;
static QTextCodec *cftr;
+ static bool validCodecs();
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QTextCodec::ConversionFlags)
-inline QTextCodec* QTextCodec::codecForTr() { return cftr; }
+ inline QTextCodec* QTextCodec::codecForTr() { return validCodecs() ? cftr : 0; }
inline void QTextCodec::setCodecForTr(QTextCodec *c) { cftr = c; }
-inline QTextCodec* QTextCodec::codecForCStrings() { return QString::codecForCStrings; }
+inline QTextCodec* QTextCodec::codecForCStrings() { return validCodecs() ? QString::codecForCStrings : 0; }
inline void QTextCodec::setCodecForCStrings(QTextCodec *c) { QString::codecForCStrings = c; }
class Q_CORE_EXPORT QTextEncoder {