[SCM] ktp-auth-handler packaging branch, master, updated. debian/15.12.1-2-282-g080758e
Maximiliano Curia
maxy at moszumanska.debian.org
Fri May 27 23:59:18 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-auth-handler.git;a=commitdiff;h=49ed198
The following commit has been merged in the master branch:
commit 49ed198b3b26b1a20b7fa46c208624cffad94755
Author: Àlex Fiestas <afiestas at kde.org>
Date: Mon Jun 10 17:24:48 2013 +0200
Remove repeated code and comments
---
sasl-auth-op.cpp | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/sasl-auth-op.cpp b/sasl-auth-op.cpp
index b8cd65d..2af8dfd 100644
--- a/sasl-auth-op.cpp
+++ b/sasl-auth-op.cpp
@@ -72,6 +72,10 @@ void SaslAuthOp::gotProperties(Tp::PendingOperation *op)
QStringList mechanisms = qdbus_cast<QStringList>(props.value(QLatin1String("AvailableMechanisms")));
kDebug() << mechanisms;
+ uint status = qdbus_cast<uint>(props.value(QLatin1String("SASLStatus")));
+ QString error = qdbus_cast<QString>(props.value(QLatin1String("SASLError")));
+ QVariantMap errorDetails = qdbus_cast<QVariantMap>(props.value(QLatin1String("SASLErrorDetails")));
+
#ifdef HAVE_SSO
if (mechanisms.contains(QLatin1String("X-FACEBOOK-PLATFORM")) && m_accountStorageId) {
XTelepathySSOOperation *authop = new XTelepathySSOOperation(m_account, m_accountStorageId, m_saslIface);
@@ -79,10 +83,6 @@ void SaslAuthOp::gotProperties(Tp::PendingOperation *op)
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onAuthOperationFinished(Tp::PendingOperation*)));
- //FIXME this is repeated code...move it outside the if???
- uint status = qdbus_cast<uint>(props.value(QLatin1String("SASLStatus")));
- QString error = qdbus_cast<QString>(props.value(QLatin1String("SASLError")));
- QVariantMap errorDetails = qdbus_cast<QVariantMap>(props.value(QLatin1String("SASLErrorDetails")));
authop->onSASLStatusChanged(status, error, errorDetails);
}
else if(mechanisms.contains(QLatin1String("X-OAUTH2")) && m_accountStorageId) {
@@ -91,34 +91,24 @@ void SaslAuthOp::gotProperties(Tp::PendingOperation *op)
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onAuthOperationFinished(Tp::PendingOperation*)));
- //FIXME this is repeated code...move it outside the if???
- uint status = qdbus_cast<uint>(props.value(QLatin1String("SASLStatus")));
- QString error = qdbus_cast<QString>(props.value(QLatin1String("SASLError")));
- QVariantMap errorDetails = qdbus_cast<QVariantMap>(props.value(QLatin1String("SASLErrorDetails")));
authop->onSASLStatusChanged(status, error, errorDetails);
} else //if...
#endif
if (mechanisms.contains(QLatin1String("X-TELEPATHY-PASSWORD"))) {
- // everything ok, we can return from handleChannels now
Q_EMIT ready(this);
XTelepathyPasswordAuthOperation *authop = new XTelepathyPasswordAuthOperation(m_account, m_saslIface, m_walletInterface, qdbus_cast<bool>(props.value(QLatin1String("CanTryAgain"))));
connect(authop,
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onAuthOperationFinished(Tp::PendingOperation*)));
- uint status = qdbus_cast<uint>(props.value(QLatin1String("SASLStatus")));
- QString error = qdbus_cast<QString>(props.value(QLatin1String("SASLError")));
- QVariantMap errorDetails = qdbus_cast<QVariantMap>(props.value(QLatin1String("SASLErrorDetails")));
+
authop->onSASLStatusChanged(status, error, errorDetails);
} else if (mechanisms.contains(QLatin1String("X-MESSENGER-OAUTH2"))) {
- // everything ok, we can return from handleChannels now
Q_EMIT ready(this);
XMessengerOAuth2AuthOperation *authop = new XMessengerOAuth2AuthOperation(m_account, m_saslIface, m_walletInterface);
connect(authop,
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onAuthOperationFinished(Tp::PendingOperation*)));
- uint status = qdbus_cast<uint>(props.value(QLatin1String("SASLStatus")));
- QString error = qdbus_cast<QString>(props.value(QLatin1String("SASLError")));
- QVariantMap errorDetails = qdbus_cast<QVariantMap>(props.value(QLatin1String("SASLErrorDetails")));
+
authop->onSASLStatusChanged(status, error, errorDetails);
} else {
kWarning() << "X-TELEPATHY-PASSWORD and X-MESSENGER-OAUTH2 are the only supported SASL mechanism and are not available:" << mechanisms;
--
ktp-auth-handler packaging
More information about the pkg-kde-commits
mailing list