From 662c0a722a70cbd727e0b208777a787439705736 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 21 May 2012 13:15:28 +0200 Subject: 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 Reviewed-by: Lars Knoll --- src/corelib/plugin/qfactoryloader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/corelib/plugin') diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 67b59f96ec..1e70e340d0 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -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(); -- cgit v1.2.3