Small cleanups
Summary: Move implementation to cpp file, port away from deprecated API. Reviewers: #frameworks, #plasma, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: plasma-devel Tags: #plasma, #frameworks Differential Revision: https://phabricator.kde.org/D4931
This commit is contained in:
parent
b99a87a320
commit
3a9fc22724
@ -125,7 +125,7 @@ void ConfigViewPrivate::init()
|
|||||||
|
|
||||||
if (corona->kPackage().isValid()) {
|
if (corona->kPackage().isValid()) {
|
||||||
PackageUrlInterceptor *interceptor = new PackageUrlInterceptor(q->engine(), corona->package());
|
PackageUrlInterceptor *interceptor = new PackageUrlInterceptor(q->engine(), corona->package());
|
||||||
interceptor->addAllowedPath(applet.data()->package().path());
|
interceptor->addAllowedPath(applet.data()->kPackage().path());
|
||||||
q->engine()->setUrlInterceptor(interceptor);
|
q->engine()->setUrlInterceptor(interceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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"
|
#include "moc_wallpaperinterface.cpp"
|
||||||
|
@ -85,16 +85,7 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE QAction *action(QString name) const;
|
Q_INVOKABLE QAction *action(QString name) const;
|
||||||
|
|
||||||
static WallpaperInterface *qmlAttachedProperties(QObject *object)
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void packageChanged();
|
void packageChanged();
|
||||||
|
Loading…
Reference in New Issue
Block a user