[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/plasma/dataengines/presence
From: Siraj Razick <siraj () kdemail ! net>
Date: 2009-02-25 17:43:54
Message-ID: 1235583834.385662.17068.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 931710 by siraj:
Add currentPresenceChanged slot so icon updates when presnce of the account changes
M +12 -2 presence.cpp
M +4 -1 presence.h
--- trunk/playground/base/plasma/dataengines/presence/presence.cpp #931709:931710
@@ -18,7 +18,6 @@
#include "presence.h"
-#include <TelepathyQt4/Client/Account>
#include <TelepathyQt4/Client/AccountManager>
#include <TelepathyQt4/Client/PendingReadyAccountManager>
#include <TelepathyQt4/Client/PendingReadyAccount>
@@ -202,7 +201,8 @@
kDebug();
kDebug() << path;
QSharedPointer<Telepathy::Client::Account> account = accountFromPath(path);
-
+ QObject::connect(account.data(), SIGNAL(currentPresenceChanged(const \
Telepathy::SimplePresence &)), this + , \
SLOT(currentPresenceChanged(const Telepathy::SimplePresence &)));
QObject::connect(account->becomeReady(), \
SIGNAL(finished(Telepathy::Client::PendingOperation *)),
this, SLOT(onExistingAccountReady(Telepathy::Client::PendingOperation *)));
}
@@ -256,5 +256,15 @@
return false;
}
+void PresenceEngine::currentPresenceChanged(const Telepathy::SimplePresence & \
presence) +{
+ QVariant vsp;
+ vsp.setValue(presence);
+ foreach (QString source, sources()) {
+ setData(source, "current_presence", vsp);
+ }
+ updateAllSources();
+}
+
#include "presence.moc"
--- trunk/playground/base/plasma/dataengines/presence/presence.h #931709:931710
@@ -21,7 +21,9 @@
#include <plasma/dataengine.h>
#include <TelepathyQt4/Client/PendingOperation>
+#include <TelepathyQt4/Client/Account>
+
#include <QSharedPointer>
class QDBusObjectPath;
@@ -47,12 +49,13 @@
bool sourceRequestEvent(const QString & name);
private slots:
- void onAccountReady(Telepathy::Client::PendingOperation *operation);
+ void onAccountReady(Telepathy::Client::PendingOperation *operation);
void onExistingAccountReady(Telepathy::Client::PendingOperation *);
bool isOperationError(Telepathy::Client::PendingOperation *);
void accountCreated(const QString &path);
void accountRemoved(const QString &path);
void accountValidityChanged(const QString &path, bool valid);
+ void currentPresenceChanged(const Telepathy::SimplePresence &);
private:
QSharedPointer<Telepathy::Client::Account> accountFromPath(const QString &path);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic