use QCoreApplication::applicationName() instead of KAboutData

This commit is contained in:
Aaron Seigo 2012-09-23 17:21:18 +02:00
parent 5652490a0e
commit 35590c27eb

View File

@ -28,12 +28,19 @@
#include <QGraphicsLayout>
#include <QGraphicsView>
#include <QHostInfo>
#include <qstandardpaths.h>
#include <kaction.h>
#include <kdebug.h>
#include <kkeysequencewidget.h>
#include <kstandarddirs.h>
#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 <kaction.h>
#include <kkeysequencewidget.h>
#include <kstandarddirs.h>
#include <kaboutdata.h>
#include <qstandardpaths.h>
namespace Plasma
{
@ -566,8 +567,13 @@ void AppletPrivate::filterOffers(QList<KService::Ptr> &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);