summaryrefslogtreecommitdiffstats
path: root/src/tools/rcc
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2014-10-10 12:04:17 +0200
committerhjk <hjk121@nokiamail.com>2014-10-10 16:45:50 +0200
commit7c90778487fee7c53e27766ac895c620ad566049 (patch)
tree1905f6d08ad672eecd51997ab12f042804b2b21f /src/tools/rcc
parent8c538d10da618add00aba1acbc8d8dc2f24445b4 (diff)
Account for the country/language settings when checking for duplicates
When a file has the same alias but a different country or language setting then it should not warn about it being a potential duplicate. Task-number: QTBUG-19286 Change-Id: I60a9c422ff02214399bdea3791374a65c9f6c604 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/tools/rcc')
-rw-r--r--src/tools/rcc/rcc.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 6d4cc12d5c..11a99d136d 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -610,11 +610,18 @@ bool RCCResourceLibrary::addFile(const QString &alias, const RCCFileInfo &file)
const QString filename = nodes.at(nodes.size()-1);
RCCFileInfo *s = new RCCFileInfo(file);
s->m_parent = parent;
- if (parent->m_children.contains(filename)) {
- foreach (const QString &fileName, m_fileNames)
- qWarning("%s: Warning: potential duplicate alias detected: '%s'",
- qPrintable(fileName), qPrintable(filename));
+ typedef QHash<QString, RCCFileInfo*>::const_iterator ChildConstIterator;
+ const ChildConstIterator cbegin = parent->m_children.constFind(filename);
+ const ChildConstIterator cend = parent->m_children.constEnd();
+ for (ChildConstIterator it = cbegin; it != cend; ++it) {
+ if (it.key() == filename && it.value()->m_language == s->m_language &&
+ it.value()->m_country == s->m_country) {
+ foreach (const QString &name, m_fileNames)
+ qWarning("%s: Warning: potential duplicate alias detected: '%s'",
+ qPrintable(name), qPrintable(filename));
+ break;
}
+ }
parent->m_children.insertMulti(filename, s);
return true;
}