From fbd8bc850e6584a0bd2266302a079eab4b9b918b Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sun, 12 Oct 2008 00:05:39 +0000 Subject: [PATCH] change when we call setName when loaded as a plugin svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=870187 --- service.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/service.cpp b/service.cpp index 92ee97651..0ba25f0c3 100644 --- a/service.cpp +++ b/service.cpp @@ -47,14 +47,7 @@ Service::Service(QObject *parent, const QVariantList &args) : QObject(parent), d(new ServicePrivate(this)) { - // remove those first item since those are managed by Service and subclasses shouldn't - // need to worry about it. yes, it violates the constness of this var, but it lets us add - // or remove items later while applets can just pretend that their args always start at 0 - QVariantList &mutableArgs = const_cast(args); - if (!mutableArgs.isEmpty()) { - setName(mutableArgs[0].toString()); - mutableArgs.removeFirst(); - } + Q_UNUSED(args) } Service::~Service() @@ -80,7 +73,7 @@ Service *Service::load(const QString &name, QObject *parent) KService::Ptr offer = offers.first(); QString error; QVariantList args; - args << name; + //args << name; Service *service = 0; if (Plasma::isPluginVersionCompatible(KPluginLoader(*offer).pluginVersion())) { @@ -92,6 +85,10 @@ Service *Service::load(const QString &name, QObject *parent) return new NullService(name, parent); } + if (service->name().isEmpty()) { + service->setName(name); + } + return service; }