From 35590c27eb7a5c4283b951ef49fd165f557dce9e Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 23 Sep 2012 17:21:18 +0200 Subject: [PATCH] use QCoreApplication::applicationName() instead of KAboutData --- private/applet_p.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/private/applet_p.cpp b/private/applet_p.cpp index dd0989108..0c52ae8dc 100644 --- a/private/applet_p.cpp +++ b/private/applet_p.cpp @@ -28,12 +28,19 @@ #include #include #include +#include + +#include +#include +#include +#include #include "abstracttoolbox.h" #include "containment.h" #include "corona.h" #include "pluginloader.h" #include "scripting/scriptengine.h" +#include "scripting/appletscript.h" #include "private/containment_p.h" #if ENABLE_REMOTE_WIDGETS @@ -42,12 +49,6 @@ #include "remote/authorizationrule.h" #endif -#include -#include -#include -#include -#include - namespace Plasma { @@ -566,8 +567,13 @@ void AppletPrivate::filterOffers(QList &offers) QString AppletPrivate::parentAppConstraint(const QString &parentApp) { if (parentApp.isEmpty()) { + QCoreApplication *app = QCoreApplication::instance(); + if (!app) { + return QString(); + } + return QString("((not exist [X-KDE-ParentApp] or [X-KDE-ParentApp] == '') or [X-KDE-ParentApp] == '%1')") - .arg(KComponentData::mainComponent().aboutData()->appName()); + .arg(app->applicationName()); } return QString("[X-KDE-ParentApp] == '%1'").arg(parentApp);