summaryrefslogtreecommitdiff
path: root/src/linguist/shared/translator.h
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2023-04-12 17:11:06 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2023-04-19 13:46:54 +0200
commit973119c4e38b4c9ce1fb589d8fa71adcf9e2f813 (patch)
tree76ae6d9d390c637623e7f5cb75ede6a546eec86a /src/linguist/shared/translator.h
parenta9804f1a6496eccb79fb006fe4c9247eee1c4cec (diff)
downloadqttools-973119c4e38b4c9ce1fb589d8fa71adcf9e2f813.tar.gz
lrelease: Report all occurrences of duplicates
Before, lrelease reported only the line number of the first of duplicated messages. To actually resolve the duplicates the user must know the occurrences of all duplicated messages. Now, lrelease reports the line numbers of all duplicated messages. Change-Id: I19836f54dcaa9b1d22a9e3e708f830769c50bff2 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Diffstat (limited to 'src/linguist/shared/translator.h')
-rw-r--r--src/linguist/shared/translator.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/linguist/shared/translator.h b/src/linguist/shared/translator.h
index 4bc88c7df..8a0957fd2 100644
--- a/src/linguist/shared/translator.h
+++ b/src/linguist/shared/translator.h
@@ -114,9 +114,15 @@ public:
void makeFileNamesAbsolute(const QDir &originalPath);
bool translationsExist() const;
- struct Duplicates { QSet<int> byId, byContents; };
+ using DuplicateEntries = QHash<int, QVector<int>>;
+ struct Duplicates
+ {
+ DuplicateEntries byId, byContents;
+ };
Duplicates resolveDuplicates();
void reportDuplicates(const Duplicates &dupes, const QString &fileName, bool verbose);
+ void reportDuplicatesLines(const TranslatorMessage &msg,
+ const DuplicateEntries::value_type &dups) const;
QString languageCode() const { return m_language; }
QString sourceLanguageCode() const { return m_sourceLanguage; }