[Telepathy-commits] [telepathy-qt4/master] PendingHandles: Only fallback (RequestHandles) if error is InvalidHandle, NotAvailable or InvalidArgument.
Andre Moreira Magalhaes (andrunko)
andre.magalhaes at collabora.co.uk
Tue Mar 24 10:51:47 PDT 2009
---
TelepathyQt4/Client/pending-handles.cpp | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/TelepathyQt4/Client/pending-handles.cpp b/TelepathyQt4/Client/pending-handles.cpp
index dbcf681..f3cbd14 100644
--- a/TelepathyQt4/Client/pending-handles.cpp
+++ b/TelepathyQt4/Client/pending-handles.cpp
@@ -265,15 +265,30 @@ void PendingHandles::onFastPathFinished(QDBusPendingCallWatcher *watcher)
QDBusPendingReply<UIntList> reply = *watcher;
if (reply.isError()) {
+ QDBusError error = reply.error();
if (mPriv->namesRequested.size() == 1) {
debug().nospace() << " Failure: error " <<
reply.error().name() << ": " <<
reply.error().message();
mPriv->invalidNames.insert(mPriv->namesRequested.first(),
- QPair<QString, QString>(reply.error().name(),
- reply.error().message()));
- setFinishedWithError(reply.error());
+ QPair<QString, QString>(error.name(),
+ error.message()));
+ setFinishedWithError(error);
+ connection()->handleRequestLanded(mPriv->handleType);
+ return;
+ }
+
+ if (error.name() != TELEPATHY_ERROR_INVALID_HANDLE &&
+ error.name() != TELEPATHY_ERROR_INVALID_ARGUMENT &&
+ error.name() != TELEPATHY_ERROR_NOT_AVAILABLE) {
+ // do not fallback
+ foreach (const QString &name, mPriv->namesRequested) {
+ mPriv->invalidNames.insert(name,
+ QPair<QString, QString>(error.name(),
+ error.message()));
+ }
+ setFinishedWithError(error);
connection()->handleRequestLanded(mPriv->handleType);
return;
}
--
1.5.6.5
More information about the telepathy-commits
mailing list