From 9abefae4fb123ff506d3a903e62da1e88c2c79e4 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 10 Mar 2012 23:51:31 +0100 Subject: [PATCH] Restore some source compatibility Add an implicit #include back in to avoid needless SC and compilation breaks. Add some deprecated method for codecForTr, until all other modules are ported to mot use it anymore. Change-Id: I5334b47a0c32819b9eb6b7203cc98ce4e6073a64 Reviewed-by: Kent Hansen --- src/corelib/codecs/qtextcodec.h | 4 ++++ src/corelib/kernel/qcoreapplication.h | 6 +++++- src/corelib/tools/qlocale.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h index b4b170f7d7..690214323d 100644 --- a/src/corelib/codecs/qtextcodec.h +++ b/src/corelib/codecs/qtextcodec.h @@ -72,6 +72,10 @@ public: static QTextCodec* codecForLocale(); static void setCodecForLocale(QTextCodec *c); +#if QT_DEPRECATED_SINCE(5, 0) + QT_DEPRECATED static QTextCodec *codecForTr() { return codecForMib(4); /* Latin1 */ } +#endif + static QTextCodec *codecForHtml(const QByteArray &ba); static QTextCodec *codecForHtml(const QByteArray &ba, QTextCodec *defaultCodec); diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 0a5181a508..cf76511f25 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -137,7 +137,11 @@ public: static void installTranslator(QTranslator * messageFile); static void removeTranslator(QTranslator * messageFile); #endif - enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = Latin1 }; + enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = Latin1 +#if QT_DEPRECATED_SINCE(5, 0) + , CodecForTr = Latin1 +#endif + }; static QString translate(const char * context, const char * key, const char * disambiguation = 0, diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h index 2ecd934100..c029f627b2 100644 --- a/src/corelib/tools/qlocale.h +++ b/src/corelib/tools/qlocale.h @@ -42,6 +42,7 @@ #ifndef QLOCALE_H #define QLOCALE_H +#include #include #include