diff --git a/src/plasmaquick/configview.cpp b/src/plasmaquick/configview.cpp index ef4cca183..1eba0b63c 100644 --- a/src/plasmaquick/configview.cpp +++ b/src/plasmaquick/configview.cpp @@ -125,7 +125,7 @@ void ConfigViewPrivate::init() 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.cpp b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp index 974a6b442..2487a3c61 100644 --- a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp +++ b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp @@ -269,4 +269,11 @@ void WallpaperInterface::executeAction(const QString &name) } } +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" diff --git a/src/scriptengines/qml/plasmoid/wallpaperinterface.h b/src/scriptengines/qml/plasmoid/wallpaperinterface.h index 7eaff3b93..08909e717 100644 --- a/src/scriptengines/qml/plasmoid/wallpaperinterface.h +++ b/src/scriptengines/qml/plasmoid/wallpaperinterface.h @@ -85,16 +85,7 @@ public: 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();