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 <kent.hansen@nokia.com>
This commit is contained in:
Lars Knoll 2012-03-10 23:51:31 +01:00 committed by Qt by Nokia
parent 2e886cfbcb
commit 9abefae4fb
3 changed files with 10 additions and 1 deletions

View File

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

View File

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

View File

@ -42,6 +42,7 @@
#ifndef QLOCALE_H
#define QLOCALE_H
#include <QtCore/qvariant.h>
#include <QtCore/qstring.h>
#include <QtCore/qobjectdefs.h>