diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-06-18 03:04:17 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-06-18 03:04:17 +0200 |
commit | b987303f9b656e440fd14fffd84287674e4ad226 (patch) | |
tree | 1b57bdb2899b507e7d50075b39fbe3fb763edf4a /src/linguist | |
parent | 3912157208a91f47274645e3e14a918438816c1d (diff) | |
parent | 945d7c1f00f08fb1cb29bd548e8c4d0a42857f67 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: If77476dd8230654b179c7020d84dd240cc3f47b9
Diffstat (limited to 'src/linguist')
-rw-r--r-- | src/linguist/lupdate/main.cpp | 4 | ||||
-rw-r--r-- | src/linguist/shared/po.cpp | 18 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index d20b4b4df..8bdfff479 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -239,9 +239,9 @@ static void printUsage() " -no-sort\n" " Do not sort contexts in TS files.\n" " -no-recursive\n" - " Do not recursively scan the following directories.\n" + " Do not recursively scan directories.\n" " -recursive\n" - " Recursively scan the following directories (default).\n" + " Recursively scan directories (default).\n" " -I <includepath> or -I<includepath>\n" " Additional location to look for include files.\n" " May be specified multiple times.\n" diff --git a/src/linguist/shared/po.cpp b/src/linguist/shared/po.cpp index a998aa0f6..4e623e6a3 100644 --- a/src/linguist/shared/po.cpp +++ b/src/linguist/shared/po.cpp @@ -151,7 +151,7 @@ static QString poEscapedLines(const QString &prefix, bool addSpace, const QStrin static QString poEscapedLines(const QString &prefix, bool addSpace, const QString &in0) { QString in = in0; - if (in.endsWith(QLatin1Char('\n'))) + if (in == QString::fromLatin1("\n")) in.chop(1); return poEscapedLines(prefix, addSpace, in.split(QLatin1Char('\n'))); } @@ -321,6 +321,7 @@ premature_eol: static void slurpComment(QByteArray &msg, const QList<QByteArray> &lines, int & l) { + int firstLine = l; QByteArray prefix = lines.at(l); for (int i = 1; ; i++) { if (prefix.at(i) != ' ') { @@ -330,11 +331,15 @@ static void slurpComment(QByteArray &msg, const QList<QByteArray> &lines, int & } for (; l < lines.size(); ++l) { const QByteArray &line = lines.at(l); - if (line.startsWith(prefix)) + if (line.startsWith(prefix)) { + if (l > firstLine) + msg += '\n'; msg += line.mid(prefix.size()); - else if (line != "#") + } else if (line == "#") { + msg += '\n'; + } else { break; - msg += '\n'; + } } --l; } @@ -525,9 +530,10 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) } } doneho: - if (lastCmtLine != -1) + if (lastCmtLine != -1) { extras[QLatin1String("po-header_comment")] = QByteArrayList_join(lines.mid(0, lastCmtLine + 1), '\n'); + } for (QHash<QString, QByteArray>::ConstIterator it = extras.constBegin(), end = extras.constEnd(); it != end; ++it) @@ -626,7 +632,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) item.id = line.mid(9); } else { item.automaticComments += line.mid(3); - item.automaticComments += '\n'; + } break; case '|': |