diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-06 22:40:23 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-06 22:58:01 +0100 |
commit | a66698f947e8ded2e020defa626b154aca1fde9f (patch) | |
tree | b91a1233b0d600ee44bee356b18065b60a4ed8f5 /tools/linguist/linguist/messagemodel.cpp | |
parent | 44cc160733a70f5dc613faed2051005de7e48f04 (diff) |
handle messages with ids (more) correctly
when comparing two messages which both have ids, compare only the ids.
this affects finding/reporting duplicates and merging.
Diffstat (limited to 'tools/linguist/linguist/messagemodel.cpp')
-rw-r--r-- | tools/linguist/linguist/messagemodel.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/linguist/linguist/messagemodel.cpp b/tools/linguist/linguist/messagemodel.cpp index 89666242e9..024fd9110a 100644 --- a/tools/linguist/linguist/messagemodel.cpp +++ b/tools/linguist/linguist/messagemodel.cpp @@ -210,9 +210,16 @@ bool DataModel::load(const QString &fileName, bool *langGuessed, QWidget *parent } Translator::Duplicates dupes = tor.resolveDuplicates(); - if (!dupes.byContents.isEmpty()) { + if (!dupes.byId.isEmpty() || !dupes.byContents.isEmpty()) { QString err = tr("<qt>Duplicate messages found in '%1':").arg(Qt::escape(fileName)); int numdups = 0; + foreach (int i, dupes.byId) { + if (++numdups >= 5) { + err += tr("<p>[more duplicates omitted]"); + goto doWarn; + } + err += tr("<p>* ID: %1").arg(Qt::escape(tor.message(i).id())); + } foreach (int j, dupes.byContents) { const TranslatorMessage &msg = tor.message(j); if (++numdups >= 5) { @@ -224,6 +231,7 @@ bool DataModel::load(const QString &fileName, bool *langGuessed, QWidget *parent if (!msg.comment().isEmpty()) err += tr("<br>* Comment: %3").arg(Qt::escape(msg.comment())); } + doWarn: QMessageBox::warning(parent, QObject::tr("Qt Linguist"), err); } |