Use less deprecated API

Makes it easier to look at the compilation output.

REVIEW: 129150
This commit is contained in:
Aleix Pol Gonzalez 2016-10-17 13:36:15 +02:00 committed by Aleix Pol
parent 05e86467c4
commit 9e54853ac8
8 changed files with 16 additions and 16 deletions

View File

@ -204,10 +204,10 @@ void Containment::restore(KConfigGroup &group)
case Plasma::Types::PanelContainment: case Plasma::Types::PanelContainment:
/* fall through*/ /* fall through*/
case Plasma::Types::CustomPanelContainment: case Plasma::Types::CustomPanelContainment:
defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->package().filePath("defaults")), "Panel"); defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->kPackage().filePath("defaults")), "Panel");
break; break;
case Plasma::Types::DesktopContainment: case Plasma::Types::DesktopContainment:
defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->package().filePath("defaults")), "Desktop"); defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->kPackage().filePath("defaults")), "Desktop");
break; break;
default: default:
//for any other type of containment, there are no defaults //for any other type of containment, there are no defaults

View File

@ -102,7 +102,7 @@ void AppletScript::configChanged()
QString AppletScript::mainScript() const QString AppletScript::mainScript() const
{ {
Q_ASSERT(d->applet); Q_ASSERT(d->applet);
return d->applet->package().filePath("mainscript"); return d->applet->kPackage().filePath("mainscript");
} }
Package AppletScript::package() const Package AppletScript::package() const

View File

@ -480,7 +480,7 @@ void AppletQuickItem::init()
//if the engine of the qmlObject is different from the static one, then we //if the engine of the qmlObject is different from the static one, then we
//are using an old version of the api in which every applet had one engine //are using an old version of the api in which every applet had one engine
//so initialize a private url interceptor //so initialize a private url interceptor
if (d->applet->package().isValid() && !qobject_cast<KDeclarative::QmlObjectSharedEngine *>(d->qmlObject)) { if (d->applet->kPackage().isValid() && !qobject_cast<KDeclarative::QmlObjectSharedEngine *>(d->qmlObject)) {
PackageUrlInterceptor *interceptor = new PackageUrlInterceptor(engine, d->applet->package()); PackageUrlInterceptor *interceptor = new PackageUrlInterceptor(engine, d->applet->package());
interceptor->addAllowedPath(d->coronaPackage.path()); interceptor->addAllowedPath(d->coronaPackage.path());
engine->setUrlInterceptor(interceptor); engine->setUrlInterceptor(interceptor);
@ -501,11 +501,11 @@ void AppletQuickItem::init()
QObject *o = c.create(); QObject *o = c.create();
o->deleteLater(); o->deleteLater();
d->qmlObject->setSource(QUrl::fromLocalFile(d->applet->package().filePath("mainscript"))); d->qmlObject->setSource(QUrl::fromLocalFile(d->applet->kPackage().filePath("mainscript")));
if (!engine || !engine->rootContext() || !engine->rootContext()->isValid() || !d->qmlObject->mainComponent() || d->qmlObject->mainComponent()->isError()) { if (!engine || !engine->rootContext() || !engine->rootContext()->isValid() || !d->qmlObject->mainComponent() || d->qmlObject->mainComponent()->isError()) {
QString reason; QString reason;
if (d->applet->package().isValid()) { if (d->applet->kPackage().isValid()) {
foreach (QQmlError error, d->qmlObject->mainComponent()->errors()) { foreach (QQmlError error, d->qmlObject->mainComponent()->errors()) {
reason += error.toString() + '\n'; reason += error.toString() + '\n';
} }

View File

@ -114,7 +114,7 @@ void ConfigViewPrivate::init()
if (a) { if (a) {
corona = a->containment()->corona(); corona = a->containment()->corona();
} }
} else if (!applet.data()->containment()->corona()->package().isValid()) { } else if (!applet.data()->containment()->corona()->kPackage().isValid()) {
qWarning() << "Invalid home screen package"; qWarning() << "Invalid home screen package";
} else { } else {
corona = applet.data()->containment()->corona(); corona = applet.data()->containment()->corona();
@ -124,7 +124,7 @@ void ConfigViewPrivate::init()
return; return;
} }
if (corona->package().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()->package().path());
q->engine()->setUrlInterceptor(interceptor); q->engine()->setUrlInterceptor(interceptor);
@ -133,7 +133,7 @@ void ConfigViewPrivate::init()
q->setResizeMode(QQuickView::SizeViewToRootObject); q->setResizeMode(QQuickView::SizeViewToRootObject);
//config model local of the applet //config model local of the applet
QQmlComponent *component = new QQmlComponent(q->engine(), QUrl::fromLocalFile(applet.data()->package().filePath("configmodel")), q); QQmlComponent *component = new QQmlComponent(q->engine(), QUrl::fromLocalFile(applet.data()->kPackage().filePath("configmodel")), q);
QObject *object = component->beginCreate(q->engine()->rootContext()); QObject *object = component->beginCreate(q->engine()->rootContext());
configModel = qobject_cast<ConfigModel *>(object); configModel = qobject_cast<ConfigModel *>(object);
@ -289,7 +289,7 @@ ConfigView::~ConfigView()
void ConfigView::init() void ConfigView::init()
{ {
setSource(QUrl::fromLocalFile(d->corona->package().filePath("appletconfigurationui"))); setSource(QUrl::fromLocalFile(d->corona->kPackage().filePath("appletconfigurationui")));
} }
Plasma::Applet *ConfigView::applet() Plasma::Applet *ConfigView::applet()

View File

@ -205,7 +205,7 @@ ContainmentView::ContainmentView(Plasma::Corona *corona, QWindow *parent)
QObject::connect(screen(), &QScreen::geometryChanged, QObject::connect(screen(), &QScreen::geometryChanged,
this, &ContainmentView::screenGeometryChanged); this, &ContainmentView::screenGeometryChanged);
if (corona->package().isValid()) { if (corona->kPackage().isValid()) {
KPluginInfo info = corona->package().metadata(); KPluginInfo info = corona->package().metadata();
if (info.isValid()) { if (info.isValid()) {
setTranslationDomain("plasma_shell_" + info.pluginName()); setTranslationDomain("plasma_shell_" + info.pluginName());

View File

@ -188,14 +188,14 @@ View::View(Plasma::Corona *corona, QWindow *parent)
QObject::connect(screen(), &QScreen::geometryChanged, QObject::connect(screen(), &QScreen::geometryChanged,
this, &View::screenGeometryChanged); this, &View::screenGeometryChanged);
if (corona->package().isValid()) { if (corona->kPackage().isValid()) {
PackageUrlInterceptor *interceptor = new PackageUrlInterceptor(engine(), corona->package()); PackageUrlInterceptor *interceptor = new PackageUrlInterceptor(engine(), corona->package());
engine()->setUrlInterceptor(interceptor); engine()->setUrlInterceptor(interceptor);
KDeclarative::KDeclarative kdeclarative; KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine()); kdeclarative.setDeclarativeEngine(engine());
//binds things like kconfig and icons //binds things like kconfig and icons
kdeclarative.setTranslationDomain("plasma_shell_" + corona->package().metadata().pluginName()); kdeclarative.setTranslationDomain("plasma_shell_" + corona->kPackage().metadata().pluginId());
kdeclarative.setupBindings(); kdeclarative.setupBindings();
} else { } else {
qWarning() << "Invalid home screen package"; qWarning() << "Invalid home screen package";

View File

@ -92,9 +92,9 @@ void ContainmentInterface::init()
if (m_containment) { if (m_containment) {
KConfigGroup defaults; KConfigGroup defaults;
if (m_containment->containmentType() == Plasma::Types::DesktopContainment) { if (m_containment->containmentType() == Plasma::Types::DesktopContainment) {
defaults = KConfigGroup(KSharedConfig::openConfig(m_containment->corona()->package().filePath("defaults")), "Desktop"); defaults = KConfigGroup(KSharedConfig::openConfig(m_containment->corona()->kPackage().filePath("defaults")), "Desktop");
} else if (m_containment->containmentType() == Plasma::Types::PanelContainment) { } else if (m_containment->containmentType() == Plasma::Types::PanelContainment) {
defaults = KConfigGroup(KSharedConfig::openConfig(m_containment->corona()->package().filePath("defaults")), "Panel"); defaults = KConfigGroup(KSharedConfig::openConfig(m_containment->corona()->kPackage().filePath("defaults")), "Panel");
} }
if (defaults.isValid()) { if (defaults.isValid()) {

View File

@ -94,7 +94,7 @@ bool DeclarativeAppletScript::init()
QString DeclarativeAppletScript::filePath(const QString &type, const QString &file) const QString DeclarativeAppletScript::filePath(const QString &type, const QString &file) const
{ {
return package().filePath(type.toLocal8Bit().constData(), file); return applet()->kPackage().filePath(type.toLocal8Bit().constData(), file);
} }
void DeclarativeAppletScript::constraintsEvent(Plasma::Types::Constraints constraints) void DeclarativeAppletScript::constraintsEvent(Plasma::Types::Constraints constraints)