diff --git a/src/plasmaquick/configview.cpp b/src/plasmaquick/configview.cpp --- a/src/plasmaquick/configview.cpp +++ b/src/plasmaquick/configview.cpp @@ -125,7 +125,7 @@ if (corona->kPackage().isValid()) { PackageUrlInterceptor *interceptor = new PackageUrlInterceptor(q->engine(), corona->package()); - interceptor->addAllowedPath(applet.data()->package().path()); + interceptor->addAllowedPath(applet.data()->kPackage().path()); q->engine()->setUrlInterceptor(interceptor); } diff --git a/src/scriptengines/qml/plasmoid/wallpaperinterface.h b/src/scriptengines/qml/plasmoid/wallpaperinterface.h --- a/src/scriptengines/qml/plasmoid/wallpaperinterface.h +++ b/src/scriptengines/qml/plasmoid/wallpaperinterface.h @@ -85,16 +85,7 @@ Q_INVOKABLE QAction *action(QString name) const; - static WallpaperInterface *qmlAttachedProperties(QObject *object) - { - //at the moment of the attached object creation, the root item is the only one that hasn't a parent - //only way to avoid creation of this attached for everybody but the root item - if (!object->parent() && s_rootObjects.contains(QtQml::qmlEngine(object))) { - return s_rootObjects.value(QtQml::qmlEngine(object)); - } else { - return 0; - } - } + static WallpaperInterface *qmlAttachedProperties(QObject *object); Q_SIGNALS: void packageChanged(); diff --git a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp --- a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp +++ b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp @@ -269,4 +269,11 @@ } } +WallpaperInterface * WallpaperInterface::qmlAttachedProperties(QObject* object) +{ + //at the moment of the attached object creation, the root item is the only one that hasn't a parent + //only way to avoid creation of this attached for everybody but the root item + return object->parent() ? nullptr : s_rootObjects.value(QtQml::qmlEngine(object)); +} + #include "moc_wallpaperinterface.cpp"