From kde-commits Wed Feb 25 21:13:04 2009 From: Siraj Razick Date: Wed, 25 Feb 2009 21:13:04 +0000 To: kde-commits Subject: playground/base/plasma/dataengines/presence Message-Id: <1235596384.573767.32253.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123559640429533 SVN commit 931860 by siraj: clean up the coding style, remove extra spaces, and tidy up..etc so code looks nice and neat :) M +34 -40 presence.cpp --- trunk/playground/base/plasma/dataengines/presence/presence.cpp #931859:931860 @@ -83,19 +83,17 @@ * which will provide all the data to this * data engine. */ - m_accountManager = - new Telepathy::Client::AccountManager(QDBusConnection::sessionBus()); - + m_accountManager = + new Telepathy::Client::AccountManager(QDBusConnection::sessionBus()); + /* * connect signal from the account manager * to waiting when it's ready */ connect(m_accountManager->becomeReady(), - SIGNAL(finished(Telepathy::Client::PendingOperation*)), - this, - SLOT(onAccountReady(Telepathy::Client::PendingOperation*)) - ); - + SIGNAL(finished(Telepathy::Client::PendingOperation*)), + this,SLOT(onAccountReady(Telepathy::Client::PendingOperation*))); + /* * connect signals from the account manager * to slots within this data engine. @@ -115,12 +113,12 @@ /** * Return whether source exist. - * + * * \return \c true if source exists. */ bool PresenceEngine::sourceRequestEvent(const QString & name) { - kDebug(); + kDebug(); /* * if the visualisation requests a * source that is not already there @@ -133,13 +131,13 @@ void PresenceEngine::onAccountReady(Telepathy::Client::PendingOperation *operation) { - kDebug(); + kDebug(); if(isOperationError(operation)) return; - + QStringList pathList = m_accountManager->allAccountPaths(); kDebug() << "All Account Paths: " << pathList.size(); - + /* * get a list of all the accounts that * are all ready there @@ -151,7 +149,7 @@ /** * Slot for new account. - * + * * \param path QDBusObjectPath to created account. */ void PresenceEngine::accountCreated(const QString &path) @@ -165,13 +163,13 @@ /** * Slot for account data changed. - * + * * \param QDBusObjectPath Name of the account path. * \param valid true if the account is valid. */ void PresenceEngine::accountValidityChanged(const QString &path, bool valid) { - Q_UNUSED(valid); + Q_UNUSED(valid); kDebug(); /* * slot called when an account has @@ -182,7 +180,7 @@ /** * Slot for account removed. - * + * * \param QDBusObjectPath Name of the account path. */ void PresenceEngine::accountRemoved(const QString &path) @@ -198,11 +196,10 @@ void PresenceEngine::createAccountDataSource(const QString &path) { - kDebug(); - kDebug() << path; - QSharedPointer account = accountFromPath(path); - QObject::connect(account.data(), SIGNAL(currentPresenceChanged(const Telepathy::SimplePresence &)), this - , SLOT(currentPresenceChanged(const Telepathy::SimplePresence &))); + kDebug() << path; + QSharedPointer 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 *))); } @@ -210,7 +207,7 @@ void PresenceEngine::onExistingAccountReady(Telepathy::Client::PendingOperation *operation) { kDebug(); - + if(isOperationError(operation)) return; @@ -219,24 +216,22 @@ return; Telepathy::Client::Account *account = pa->account(); - - QString source; - source = account->uniqueIdentifier(); - Telepathy::SimplePresence sp = account->currentPresence(); - QVariant vsp; - vsp.setValue(sp); - setData(source, "current_presence", vsp); + QString source; + source = account->uniqueIdentifier(); + Telepathy::SimplePresence sp = account->currentPresence(); + QVariant vsp; + vsp.setValue(sp); + setData(source, "current_presence", vsp); } void PresenceEngine::removeAccountDataSource(const QString &path) { - kDebug(); - kDebug() << path; + kDebug() << path; - QSharedPointer account = accountFromPath(path); - QString identifier = account->uniqueIdentifier(); - removeSource(identifier); + QSharedPointer account = accountFromPath(path); + QString identifier = account->uniqueIdentifier(); + removeSource(identifier); } QSharedPointer PresenceEngine::accountFromPath(const QString &path) @@ -247,11 +242,10 @@ bool PresenceEngine::isOperationError(Telepathy::Client::PendingOperation *operation) { - if(operation->isError()) - { - kDebug() << operation->errorName() << ": " << operation->errorMessage(); - return true; - } + if (operation->isError()) { + kDebug() << operation->errorName() << ": " << operation->errorMessage(); + return true; + } return false; }