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:
Aleix Pol 2017-03-04 02:04:06 +01:00
parent b99a87a320
commit 3a9fc22724
3 changed files with 9 additions and 11 deletions

View File

@ -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);
}

View File

@ -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"

View File

@ -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();