Don't reject plugins that have empty meta-data

Having an empty Json object ({}) should be valid meta-data but this
check means that there needs to be at least one key-value pair or
the plugin will be rejected.

Change-Id: I578ccc35016af16fd30b3807e796fa63c0282f30
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Lincoln Ramsay 2012-03-16 12:08:51 +10:00 committed by Qt by Nokia
parent d823646db3
commit 7f67d0810e

View File

@ -175,7 +175,6 @@ void QFactoryLoader::update()
QString iid = library->metaData.value(QLatin1String("IID")).toString(); QString iid = library->metaData.value(QLatin1String("IID")).toString();
if (iid == QLatin1String(d->iid.constData(), d->iid.size())) { if (iid == QLatin1String(d->iid.constData(), d->iid.size())) {
QJsonObject object = library->metaData.value(QLatin1String("MetaData")).toObject(); QJsonObject object = library->metaData.value(QLatin1String("MetaData")).toObject();
if (!object.isEmpty())
metaDataOk = true; metaDataOk = true;
QJsonArray k = object.value(QLatin1String("Keys")).toArray(); QJsonArray k = object.value(QLatin1String("Keys")).toArray();