diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-23 10:33:03 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-23 10:33:03 (GMT) |
commit | 8759a330bd13174d79087fd16e4529ac44e4516f (patch) | |
tree | 8d350328b55bc8725140557c234132368ad26aa7 /tools/linguist/shared/translator.cpp | |
parent | 7e7e3c3fe15780aa7d024e136acaf697ab49458c (diff) | |
parent | aae4b037317a9ad0d41022d6309f1d4f36443764 (diff) | |
download | Qt-8759a330bd13174d79087fd16e4529ac44e4516f.zip Qt-8759a330bd13174d79087fd16e4529ac44e4516f.tar.gz Qt-8759a330bd13174d79087fd16e4529ac44e4516f.tar.bz2 |
Merge remote branch 'staging/4.6' into 4.6
Diffstat (limited to 'tools/linguist/shared/translator.cpp')
-rw-r--r-- | tools/linguist/shared/translator.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index 05fc6e5..8a071d3 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -67,7 +67,7 @@ QString QObject::tr(const char *sourceText, const char *, int n) #endif Translator::Translator() : - m_codecName("ISO-8859-1"), + m_codec(QTextCodec::codecForName("ISO-8859-1")), m_locationsType(AbsoluteLocations) { } @@ -713,12 +713,17 @@ void Translator::setCodecName(const QByteArray &name) if (!codec) { if (!name.isEmpty()) qWarning("No QTextCodec for %s available. Using Latin1\n", name.constData()); - m_codecName = "ISO-8859-1"; + m_codec = QTextCodec::codecForName("ISO-8859-1"); } else { - m_codecName = codec->name(); + m_codec = codec; } } +QByteArray Translator::codecName() const +{ + return m_codec->name(); +} + void Translator::dump() const { for (int i = 0; i != messageCount(); ++i) |