aboutsummaryrefslogtreecommitdiff
path: root/src/corelib/theme/mlogicalvalues.cpp
diff options
context:
space:
mode:
authorArmin Berres <armin.berres@basyskom.de>2010-11-16 11:02:01 +0100
committerArmin Berres <armin.berres@basyskom.de>2010-11-16 11:30:15 +0100
commit4c0415142a35ea38321b2a9d9cca80a92f2d3f01 (patch)
treeb4c5e4ca513f8ca16eb34fb4a5fd8ce3c2cf7000 /src/corelib/theme/mlogicalvalues.cpp
parentbecb4654219d48b758213799b4c97a306eaced80 (diff)
Changes: properly merge logical values
RevBy: Stanislav Ionascu, Kuisma Salonen Details: The inheritance hierarchy has not been respected. Values lower in the hierarchy have been overwriting ones from higher up in the hierarchy.
Diffstat (limited to 'src/corelib/theme/mlogicalvalues.cpp')
-rw-r--r--src/corelib/theme/mlogicalvalues.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/corelib/theme/mlogicalvalues.cpp b/src/corelib/theme/mlogicalvalues.cpp
index 4882e1dc..1107cf3c 100644
--- a/src/corelib/theme/mlogicalvalues.cpp
+++ b/src/corelib/theme/mlogicalvalues.cpp
@@ -185,6 +185,22 @@ QString MLogicalValuesPrivate::createBinaryFilename(const QFileInfo &fileInfo) c
return binaryFilename;
}
+void MLogicalValuesPrivate::mergeGroups(const Groups &groups)
+{
+ Groups::const_iterator i = groups.constBegin();
+ while (i != groups.constEnd()) {
+ Values &values = data[i.key()];
+ Values::const_iterator j = i.value().constBegin();
+ while (j != i.value().constEnd()) {
+ if (!values.contains(j.key())) {
+ values.insert(j.key(), j.value());
+ }
+ ++j;
+ }
+ ++i;
+ }
+}
+
bool MLogicalValues::append(const QString &fileName)
{
Q_D(MLogicalValues);
@@ -203,12 +219,7 @@ bool MLogicalValues::append(const QString &fileName)
d->timestamps << fileInfo.lastModified().toTime_t();
- Groups::const_iterator i = groups.constBegin();
- while (i != groups.constEnd()) {
- Values &values = d->data[i.key()];
- values.unite(i.value());
- ++i;
- }
+ d->mergeGroups(groups);
return true;
}