summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared/translatormessage.h
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-04-01 15:51:27 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-04-02 07:56:07 (GMT)
commit385bb34a9dc8e7bd6d1d3c11247862b87978d629 (patch)
treea93c84529181ab715bf44648ea9287727bd01a55 /tools/linguist/shared/translatormessage.h
parent4e036ebbc6351a9bd6597e89a803f5c4de746092 (diff)
downloadQt-385bb34a9dc8e7bd6d1d3c11247862b87978d629.zip
Qt-385bb34a9dc8e7bd6d1d3c11247862b87978d629.tar.gz
Qt-385bb34a9dc8e7bd6d1d3c11247862b87978d629.tar.bz2
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/shared/translatormessage.h')
-rw-r--r--tools/linguist/shared/translatormessage.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/linguist/shared/translatormessage.h b/tools/linguist/shared/translatormessage.h
index 363019e..7d31925 100644
--- a/tools/linguist/shared/translatormessage.h
+++ b/tools/linguist/shared/translatormessage.h
@@ -179,6 +179,32 @@ Q_DECLARE_TYPEINFO(TranslatorMessage, Q_MOVABLE_TYPE);
int qHash(const TranslatorMessage &msg);
+struct TranslatorMessagePtr {
+ TranslatorMessagePtr(const TranslatorMessage &tm)
+ {
+ ptr = &tm;
+ }
+
+ inline const TranslatorMessage *operator->() const
+ {
+ return ptr;
+ }
+
+ const TranslatorMessage *ptr;
+};
+
+Q_DECLARE_TYPEINFO(TranslatorMessagePtr, Q_MOVABLE_TYPE);
+
+static inline int qHash(TranslatorMessagePtr tmp)
+{
+ return qHash(*tmp.ptr);
+}
+
+static inline bool operator==(TranslatorMessagePtr tmp1, TranslatorMessagePtr tmp2)
+{
+ return *tmp1.ptr == *tmp2.ptr;
+}
+
QT_END_NAMESPACE
#endif // QT_NO_TRANSLATION