don't load hidden toolboxes

Change-Id: I96badc3f3b0c1ff0986bc74570f3dd19073e83b3
This commit is contained in:
Marco Martin 2015-01-30 21:05:38 +01:00
parent 7ef09d883d
commit 0161b2fce3

View File

@ -115,17 +115,19 @@ void ContainmentInterface::init()
interceptor->addAllowedPath(pkg.path());
}
if (pkg.isValid()) {
QObject *containmentGraphicObject = qmlObject()->rootObject();
if (pkg.metadata().isValid() && !pkg.metadata().isHidden()) {
if (pkg.isValid()) {
QObject *containmentGraphicObject = qmlObject()->rootObject();
QVariantHash toolboxProperties;
toolboxProperties["parent"] = QVariant::fromValue(this);
QObject *toolBoxObject = qmlObject()->createObjectFromSource(QUrl::fromLocalFile(pkg.filePath("mainscript")), 0, toolboxProperties);
if (toolBoxObject && containmentGraphicObject) {
containmentGraphicObject->setProperty("toolBox", QVariant::fromValue(toolBoxObject));
QVariantHash toolboxProperties;
toolboxProperties["parent"] = QVariant::fromValue(this);
QObject *toolBoxObject = qmlObject()->createObjectFromSource(QUrl::fromLocalFile(pkg.filePath("mainscript")), 0, toolboxProperties);
if (toolBoxObject && containmentGraphicObject) {
containmentGraphicObject->setProperty("toolBox", QVariant::fromValue(toolBoxObject));
}
} else {
qWarning() << "Could not load toolbox package." << pkg.path();
}
} else {
qWarning() << "Could not load toolbox package." << pkg.path();
}
}