make maps-n-hashes in maps-n-hashes work

svn path=/trunk/KDE/kdebase/runtime/; revision=1176437
This commit is contained in:
Aaron J. Seigo 2010-09-17 18:06:20 +00:00
parent 3e3c3f0f4a
commit f7c8bd278d

View File

@ -47,7 +47,13 @@ QScriptValue qScriptValueFromMap(QScriptEngine *eng, const M &map)
typename M::const_iterator end = map.constEnd(); typename M::const_iterator end = map.constEnd();
typename M::const_iterator it; typename M::const_iterator it;
for (it = begin; it != end; ++it) { for (it = begin; it != end; ++it) {
obj.setProperty(it.key(), qScriptValueFromValue(eng, it.value())); if (it.value().type() == QVariant::Hash) {
obj.setProperty(it.key(), qScriptValueFromMap(eng, it.value().toHash()));
} else if (it.value().type() == QVariant::Map) {
obj.setProperty(it.key(), qScriptValueFromMap(eng, it.value().toMap()));
} else {
obj.setProperty(it.key(), qScriptValueFromValue(eng, it.value()));
}
} }
return obj; return obj;