summaryrefslogtreecommitdiffstats
path: root/tools/linguist/linguist/messagemodel.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-04-01 17:51:27 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-04-02 09:56:07 +0200
commit385bb34a9dc8e7bd6d1d3c11247862b87978d629 (patch)
treea93c84529181ab715bf44648ea9287727bd01a55 /tools/linguist/linguist/messagemodel.cpp
parent4e036ebbc6351a9bd6597e89a803f5c4de746092 (diff)
duplicate message handling improvements
- lrelease will not abort on duplicates any more - lconvert now gets noisy, but only if messages within one file are duplicated (combining files with identical messages is ok) - lupdate stays silent, but will eliminate duplicates again - consolidate handling of dual-encoded and duplicate messages - for performance - instead of the format loader, now the app is responsible for calling the duplicate handler. this allows for the fine-grained control necessary for optimal performance. Task-number: 247738
Diffstat (limited to 'tools/linguist/linguist/messagemodel.cpp')
-rw-r--r--tools/linguist/linguist/messagemodel.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/linguist/linguist/messagemodel.cpp b/tools/linguist/linguist/messagemodel.cpp
index b049ab9acc..7a8063bb74 100644
--- a/tools/linguist/linguist/messagemodel.cpp
+++ b/tools/linguist/linguist/messagemodel.cpp
@@ -209,19 +209,19 @@ bool DataModel::load(const QString &fileName, bool *langGuessed, QWidget *parent
return false;
}
- QList<TranslatorMessage> dupes = tor.findDuplicates();
+ QSet<TranslatorMessagePtr> dupes = tor.resolveDuplicates();
if (!dupes.isEmpty()) {
QString err = tr("<qt>Duplicate messages found in '%1':").arg(Qt::escape(fileName));
int numdups = 0;
- foreach (const TranslatorMessage &msg, dupes) {
+ foreach (const TranslatorMessagePtr &msg, dupes) {
if (++numdups >= 5) {
err += tr("<p>[more duplicates omitted]");
break;
}
err += tr("<p>* Context: %1<br>* Source: %2")
- .arg(Qt::escape(msg.context()), Qt::escape(msg.sourceText()));
- if (!msg.comment().isEmpty())
- err += tr("<br>* Comment: %3").arg(Qt::escape(msg.comment()));
+ .arg(Qt::escape(msg->context()), Qt::escape(msg->sourceText()));
+ if (!msg->comment().isEmpty())
+ err += tr("<br>* Comment: %3").arg(Qt::escape(msg->comment()));
}
QMessageBox::warning(parent, QObject::tr("Qt Linguist"), err);
}