diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-06-03 16:05:47 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-06-03 16:16:48 (GMT) |
commit | 068177288001c46896d6b04c520731adb56ed288 (patch) | |
tree | f5588086116c8fa1d3d16bdefc544c6ad4fa5c49 /tools/linguist/shared | |
parent | 482159bddec1736a8854dc2db1b75cf856d00255 (diff) | |
download | Qt-068177288001c46896d6b04c520731adb56ed288.zip Qt-068177288001c46896d6b04c520731adb56ed288.tar.gz Qt-068177288001c46896d6b04c520731adb56ed288.tar.bz2 |
remove spurious empty lines in the linguist tools' output
ConversionData::error() does already newline-terminate the strings.
Diffstat (limited to 'tools/linguist/shared')
-rw-r--r-- | tools/linguist/shared/po.cpp | 16 | ||||
-rw-r--r-- | tools/linguist/shared/qm.cpp | 4 | ||||
-rw-r--r-- | tools/linguist/shared/translator.cpp | 2 | ||||
-rw-r--r-- | tools/linguist/shared/translator.h | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/tools/linguist/shared/po.cpp b/tools/linguist/shared/po.cpp index 6a1d426..a692332 100644 --- a/tools/linguist/shared/po.cpp +++ b/tools/linguist/shared/po.cpp @@ -461,7 +461,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) continue; int idx = hdr.indexOf(':'); if (idx < 0) { - cd.appendError(QString::fromLatin1("Unexpected PO header format '%1'\n") + cd.appendError(QString::fromLatin1("Unexpected PO header format '%1'") .arg(QString::fromLatin1(hdr))); error = true; break; @@ -482,7 +482,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) } else if (hdrName == "Content-Type") { if (cd.m_codecForSource.isEmpty()) { if (!hdrValue.startsWith("text/plain; charset=")) { - cd.appendError(QString::fromLatin1("Unexpected Content-Type header '%1'\n") + cd.appendError(QString::fromLatin1("Unexpected Content-Type header '%1'") .arg(QString::fromLatin1(hdrValue))); error = true; // This will avoid a flood of conversion errors. @@ -491,7 +491,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) QByteArray cod = hdrValue.mid(20); QTextCodec *cdc = QTextCodec::codecForName(cod); if (!cdc) { - cd.appendError(QString::fromLatin1("Unsupported codec '%1'\n") + cd.appendError(QString::fromLatin1("Unsupported codec '%1'") .arg(QString::fromLatin1(cod))); error = true; // This will avoid a flood of conversion errors. @@ -503,7 +503,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) } } else if (hdrName == "Content-Transfer-Encoding") { if (hdrValue != "8bit") { - cd.appendError(QString::fromLatin1("Unexpected Content-Transfer-Encoding '%1'\n") + cd.appendError(QString::fromLatin1("Unexpected Content-Transfer-Encoding '%1'") .arg(QString::fromLatin1(hdrValue))); return false; } @@ -644,7 +644,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) if (qtContexts) splitContext(&item.oldTscomment, &item.context); } else { - cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'\n")) + cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'")) .arg(l + 1).arg(codec->toUnicode(lines[l]))); error = true; } @@ -661,13 +661,13 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) } else if (line.startsWith("#~ msgctxt ")) { item.tscomment = slurpEscapedString(lines, l, 11, "#~ ", cd); } else { - cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'\n")) + cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'")) .arg(l + 1).arg(codec->toUnicode(lines[l]))); error = true; } break; default: - cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'\n")) + cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'")) .arg(l + 1).arg(codec->toUnicode(lines[l]))); error = true; break; @@ -685,7 +685,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) item.extra[QLatin1String("po-msgid_plural")] = codec->toUnicode(extra); item.isPlural = true; } else { - cd.appendError(QString(QLatin1String("PO-format error in line %1: '%2'\n")) + cd.appendError(QString(QLatin1String("PO-format error in line %1: '%2'")) .arg(l + 1).arg(codec->toUnicode(lines[l]))); error = true; } diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp index e2c4f4a..6678943 100644 --- a/tools/linguist/shared/qm.cpp +++ b/tools/linguist/shared/qm.cpp @@ -773,11 +773,11 @@ static bool saveQM(const Translator &translator, QIODevice &dev, ConversionData if (saved && cd.isVerbose()) { int generatedCount = finished + unfinished; cd.appendError(QCoreApplication::translate("LRelease", - " Generated %n translation(s) (%1 finished and %2 unfinished)\n", 0, + " Generated %n translation(s) (%1 finished and %2 unfinished)", 0, QCoreApplication::CodecForTr, generatedCount).arg(finished).arg(unfinished)); if (untranslated) cd.appendError(QCoreApplication::translate("LRelease", - " Ignored %n untranslated source text(s)\n", 0, + " Ignored %n untranslated source text(s)", 0, QCoreApplication::CodecForTr, untranslated)); } return saved; diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index 8223dc6..36af8da 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -689,7 +689,7 @@ void Translator::normalizeTranslations(ConversionData &cd) cd.appendError(QLatin1String( "Removed plural forms as the target language has less " "forms.\nIf this sounds wrong, possibly the target language is " - "not set or recognized.\n")); + "not set or recognized.")); } QString Translator::guessLanguageCodeFromFileName(const QString &filename) diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h index bb199f0..cfb2178 100644 --- a/tools/linguist/shared/translator.h +++ b/tools/linguist/shared/translator.h @@ -92,7 +92,7 @@ public: bool sortContexts() const { return m_sortContexts; } void appendError(const QString &error) { m_errors.append(error); } - QString error() const { return m_errors.join(QLatin1String("\n")); } + QString error() const { return m_errors.isEmpty() ? QString() : m_errors.join(QLatin1String("\n")) + QLatin1Char('\n'); } QStringList errors() const { return m_errors; } void clearErrors() { m_errors.clear(); } |