From 30c5c59674aa2ccbd97319f2c387dd1fc3eee6ca Mon Sep 17 00:00:00 2001 From: chani Date: Mon, 27 Oct 2008 06:20:15 +0000 Subject: [PATCH] check for plasma-overlay going away ...this isn't actually very important any more, but at least it makes the code cleaner. git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebase@876325 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- workspace/krunner/lock/lockprocess.cc | 25 ++++++++++++------------- workspace/krunner/lock/lockprocess.h | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/workspace/krunner/lock/lockprocess.cc b/workspace/krunner/lock/lockprocess.cc index f2f91260e6..a6238e93e9 100644 --- a/workspace/krunner/lock/lockprocess.cc +++ b/workspace/krunner/lock/lockprocess.cc @@ -962,7 +962,7 @@ bool LockProcess::startPlasma() kDebug() << "starting plasma-overlay"; connect(QDBusConnection::sessionBus().interface(), SIGNAL(serviceOwnerChanged(QString, QString, QString)), - SLOT(newService(QString))); + SLOT(newService(QString, QString, QString))); mPlasmaProc.setProgram("plasma-overlay"); if (mSetupMode) { mPlasmaProc << "--setup"; @@ -1028,30 +1028,29 @@ void LockProcess::stopPlasma() } } -void LockProcess::newService(QString name) +void LockProcess::newService(QString name, QString oldOwner, QString newOwner) { - //TODO reorganize this part to take all 3 strings (oldOwner, newOwner) - //and notice plasma quitting - if (mPlasmaDBus) { - kDebug() << "can't happen"; //but it does. - //maybe we should check if plasma was going *down* + Q_UNUSED(oldOwner); + if (name != "org.kde.plasma-overlay") { return; } - if (name != "org.kde.plasma-overlay") { + + if (mPlasmaDBus) { + if (newOwner.isEmpty()) { + kDebug() << "plasma ran away?"; + disablePlasma(); + } else { + kDebug() << "I'm confused!!"; + } return; } kDebug() << "plasma! yaay!"; - //disconnect(QDBusConnection::sessionBus().interface(), 0, this, 0); //no need for you any more - //FIXME might we want to know if the interface goes away? - //FIXME that disconnect isn't working anyways! wtf - mPlasmaDBus = new org::kde::plasmaoverlay::App(name, "/App", QDBusConnection::sessionBus(), this); //XXX this isn't actually used any more iirc connect(mPlasmaDBus, SIGNAL(hidden()), SLOT(unSuppressUnlock())); - //kDebug() << "should be connected"; if (!mDialogs.isEmpty()) { //whoops, activation probably failed earlier diff --git a/workspace/krunner/lock/lockprocess.h b/workspace/krunner/lock/lockprocess.h index 343561be31..14c3a695e1 100644 --- a/workspace/krunner/lock/lockprocess.h +++ b/workspace/krunner/lock/lockprocess.h @@ -116,7 +116,7 @@ private Q_SLOTS: /** * a new dbus service has come in */ - void newService(QString name); + void newService(QString name, QString oldOwner, QString newOwner); /** * tell plasma we're in idle mode */ -- 2.11.4.GIT