summaryrefslogtreecommitdiffstats
path: root/src/designer/src/lib/shared/rcc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/designer/src/lib/shared/rcc.cpp')
-rw-r--r--src/designer/src/lib/shared/rcc.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/designer/src/lib/shared/rcc.cpp b/src/designer/src/lib/shared/rcc.cpp
index b98f17e07..050c6f418 100644
--- a/src/designer/src/lib/shared/rcc.cpp
+++ b/src/designer/src/lib/shared/rcc.cpp
@@ -589,7 +589,7 @@ bool RCCResourceLibrary::addFile(const QString &alias, const RCCFileInfo &file)
parent->m_children.insert(node, s);
parent = s;
} else {
- parent = parent->m_children[node];
+ parent = *parent->m_children.constFind(node);
}
}
@@ -602,7 +602,7 @@ bool RCCResourceLibrary::addFile(const QString &alias, const RCCFileInfo &file)
qPrintable(fileName), qPrintable(filename));
}
}
- parent->m_children.insertMulti(filename, s);
+ parent->m_children.insert(filename, s);
return true;
}
@@ -895,12 +895,11 @@ bool RCCResourceLibrary::writeDataStructure()
file->m_childOffset = offset;
//sort by hash value for binary lookup
- QList<RCCFileInfo*> m_children = file->m_children.values();
- std::sort(m_children.begin(), m_children.end(), qt_rcc_compare_hash);
+ auto children = file->m_children.values();
+ std::sort(children.begin(), children.end(), qt_rcc_compare_hash);
//write out the actual data now
- for (int i = 0; i < m_children.size(); ++i) {
- RCCFileInfo *child = m_children.at(i);
+ for (RCCFileInfo *child : children) {
++offset;
if (child->m_flags & RCCFileInfo::Directory)
pending.push(child);
@@ -914,12 +913,11 @@ bool RCCResourceLibrary::writeDataStructure()
RCCFileInfo *file = pending.pop();
//sort by hash value for binary lookup
- QList<RCCFileInfo*> m_children = file->m_children.values();
- std::sort(m_children.begin(), m_children.end(), qt_rcc_compare_hash);
+ auto children = file->m_children.values();
+ std::sort(children.begin(), children.end(), qt_rcc_compare_hash);
//write out the actual data now
- for (int i = 0; i < m_children.size(); ++i) {
- RCCFileInfo *child = m_children.at(i);
+ for (RCCFileInfo *child : children) {
child->writeDataInfo(*this);
if (child->m_flags & RCCFileInfo::Directory)
pending.push(child);