Populate MetaData:Keys for compat plugins

QFactoryLoader::indexOf() expects the meta-data to contain a Keys
entry, if there were any keys. For compat plugins, the result of
the plugin's keys() function should be stored here.

Change-Id: Ifd04f90cbfce2598d71548c469baa55ca6b0b338
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Kent Hansen 2012-05-21 13:15:28 +02:00 committed by Qt by Nokia
parent 36f469bdb1
commit 662c0a722a

View File

@ -168,8 +168,12 @@ void QFactoryLoader::update()
if (instance && factory && instance->qt_metacast(d->iid))
keys = factory->keys();
if (!keys.isEmpty())
if (!keys.isEmpty()) {
metaDataOk = true;
QJsonObject object = library->metaData.value(QLatin1String("MetaData")).toObject();
object.insert(QLatin1String("Keys"), QJsonArray::fromStringList(keys));
library->metaData[QLatin1String("MetaData")] = object;
}
} else {
QString iid = library->metaData.value(QLatin1String("IID")).toString();