summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared/translator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist/shared/translator.cpp')
-rw-r--r--tools/linguist/shared/translator.cpp11
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)