diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-11-28 12:08:54 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-11-28 12:18:04 (GMT) |
commit | f4e2f1deecd322e859bfb27bc5a9ab97726481c5 (patch) | |
tree | b50dc4515108f5a19cbbd4b615cff01c13c5866c /Swift/Controllers | |
parent | 5caf2316dad81d6c02ff3e886a65121011ccc9fe (diff) | |
download | swift-f4e2f1deecd322e859bfb27bc5a9ab97726481c5.zip swift-f4e2f1deecd322e859bfb27bc5a9ab97726481c5.tar.bz2 |
Change error from optional to shared_ptr in GenericRequest
Resolves: #692
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.cpp | 2 | ||||
-rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.h | 2 | ||||
-rw-r--r-- | Swift/Controllers/Chat/MUCSearchController.cpp | 16 | ||||
-rw-r--r-- | Swift/Controllers/Chat/MUCSearchController.h | 8 | ||||
-rw-r--r-- | Swift/Controllers/MainController.cpp | 2 | ||||
-rw-r--r-- | Swift/Controllers/MainController.h | 2 | ||||
-rw-r--r-- | Swift/Controllers/RosterController.cpp | 2 | ||||
-rw-r--r-- | Swift/Controllers/RosterController.h | 2 |
8 files changed, 18 insertions, 18 deletions
diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index bbc04f6..7430f69 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -106,7 +106,7 @@ void ChatControllerBase::handleSendMessageRequest(const String &body) { postSendMessage(message->getBody(), boost::dynamic_pointer_cast<Stanza>(message)); } -void ChatControllerBase::handleSecurityLabelsCatalogResponse(boost::shared_ptr<SecurityLabelsCatalog> catalog, const boost::optional<ErrorPayload>& error) { +void ChatControllerBase::handleSecurityLabelsCatalogResponse(boost::shared_ptr<SecurityLabelsCatalog> catalog, ErrorPayload::ref error) { if (!error) { if (catalog->getLabels().size() == 0) { chatWindow_->setSecurityLabelsEnabled(false); diff --git a/Swift/Controllers/Chat/ChatControllerBase.h b/Swift/Controllers/Chat/ChatControllerBase.h index efbf7b4..e1e5e62 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.h +++ b/Swift/Controllers/Chat/ChatControllerBase.h @@ -66,7 +66,7 @@ namespace Swift { void createDayChangeTimer(); void handleSendMessageRequest(const String &body); void handleAllMessagesRead(); - void handleSecurityLabelsCatalogResponse(boost::shared_ptr<SecurityLabelsCatalog>, const boost::optional<ErrorPayload>& error); + void handleSecurityLabelsCatalogResponse(boost::shared_ptr<SecurityLabelsCatalog>, ErrorPayload::ref error); String getErrorMessage(boost::shared_ptr<ErrorPayload>); void handleDayChangeTick(); diff --git a/Swift/Controllers/Chat/MUCSearchController.cpp b/Swift/Controllers/Chat/MUCSearchController.cpp index e4592a9..7368dbb 100644 --- a/Swift/Controllers/Chat/MUCSearchController.cpp +++ b/Swift/Controllers/Chat/MUCSearchController.cpp @@ -108,9 +108,9 @@ void MUCSearchController::removeService(const JID& jid) { refreshView(); } -void MUCSearchController::handleDiscoInfoResponse(boost::shared_ptr<DiscoInfo> info, const boost::optional<ErrorPayload>& error, const JID& jid) { +void MUCSearchController::handleDiscoInfoResponse(boost::shared_ptr<DiscoInfo> info, ErrorPayload::ref error, const JID& jid) { if (error) { - handleDiscoError(jid, error.get()); + handleDiscoError(jid, error); return; } GetDiscoItemsRequest::ref discoItemsRequest = GetDiscoItemsRequest::create(jid, iqRouter_); @@ -148,9 +148,9 @@ void MUCSearchController::handleDiscoInfoResponse(boost::shared_ptr<DiscoInfo> i refreshView(); } -void MUCSearchController::handleRoomsItemsResponse(boost::shared_ptr<DiscoItems> items, const boost::optional<ErrorPayload>& error, const JID& jid) { +void MUCSearchController::handleRoomsItemsResponse(boost::shared_ptr<DiscoItems> items, ErrorPayload::ref error, const JID& jid) { if (error) { - handleDiscoError(jid, error.get()); + handleDiscoError(jid, error); return; } serviceDetails_[jid].clearRooms(); @@ -161,9 +161,9 @@ void MUCSearchController::handleRoomsItemsResponse(boost::shared_ptr<DiscoItems> refreshView(); } -void MUCSearchController::handleServerItemsResponse(boost::shared_ptr<DiscoItems> items, const boost::optional<ErrorPayload>& error, const JID& jid) { +void MUCSearchController::handleServerItemsResponse(boost::shared_ptr<DiscoItems> items, ErrorPayload::ref error, const JID& jid) { if (error) { - handleDiscoError(jid, error.get()); + handleDiscoError(jid, error); return; } if (jid.isValid()) { @@ -180,9 +180,9 @@ void MUCSearchController::handleServerItemsResponse(boost::shared_ptr<DiscoItems refreshView(); } -void MUCSearchController::handleDiscoError(const JID& jid, const ErrorPayload& error) { +void MUCSearchController::handleDiscoError(const JID& jid, ErrorPayload::ref error) { serviceDetails_[jid].setComplete(true); - serviceDetails_[jid].setError(error.getText()); + serviceDetails_[jid].setError(error->getText()); } void MUCSearchController::refreshView() { diff --git a/Swift/Controllers/Chat/MUCSearchController.h b/Swift/Controllers/Chat/MUCSearchController.h index 10988ad..f09a801 100644 --- a/Swift/Controllers/Chat/MUCSearchController.h +++ b/Swift/Controllers/Chat/MUCSearchController.h @@ -91,10 +91,10 @@ namespace Swift { private: void handleUIEvent(boost::shared_ptr<UIEvent> event); void handleAddService(const JID& jid, bool userTriggered=false); - void handleDiscoInfoResponse(boost::shared_ptr<DiscoInfo> info, const boost::optional<ErrorPayload>& error, const JID& jid); - void handleRoomsItemsResponse(boost::shared_ptr<DiscoItems> items, const boost::optional<ErrorPayload>& error, const JID& jid); - void handleServerItemsResponse(boost::shared_ptr<DiscoItems> items, const boost::optional<ErrorPayload>& error, const JID& jid); - void handleDiscoError(const JID& jid, const ErrorPayload& error); + void handleDiscoInfoResponse(boost::shared_ptr<DiscoInfo> info, ErrorPayload::ref error, const JID& jid); + void handleRoomsItemsResponse(boost::shared_ptr<DiscoItems> items, ErrorPayload::ref error, const JID& jid); + void handleServerItemsResponse(boost::shared_ptr<DiscoItems> items, ErrorPayload::ref error, const JID& jid); + void handleDiscoError(const JID& jid, ErrorPayload::ref error); void removeService(const JID& jid); void refreshView(); void loadServices(); diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index 49c4a23..8d78671 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -495,7 +495,7 @@ void MainController::setManagersOffline() { } } -void MainController::handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> info, const boost::optional<ErrorPayload>& error) { +void MainController::handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> info, ErrorPayload::ref error) { if (!error) { chatsManager_->setServerDiscoInfo(info); } diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h index d2d55ac..8f7298b 100644 --- a/Swift/Controllers/MainController.h +++ b/Swift/Controllers/MainController.h @@ -91,7 +91,7 @@ namespace Swift { void handleQuitRequest(); void handleChangeStatusRequest(StatusShow::Type show, const String &statusText); void handleDisconnected(const boost::optional<ClientError>& error); - void handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo>, const boost::optional<ErrorPayload>&); + void handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo>, ErrorPayload::ref); void handleEventQueueLengthChange(int count); void handleVCardReceived(const JID& j, VCard::ref vCard); void handleUIEvent(boost::shared_ptr<UIEvent> event); diff --git a/Swift/Controllers/RosterController.cpp b/Swift/Controllers/RosterController.cpp index 038a883..cb044fb 100644 --- a/Swift/Controllers/RosterController.cpp +++ b/Swift/Controllers/RosterController.cpp @@ -236,7 +236,7 @@ void RosterController::handleUIEvent(boost::shared_ptr<UIEvent> event) { } } -void RosterController::handleRosterSetError(boost::optional<ErrorPayload> error, boost::shared_ptr<RosterPayload> rosterPayload) { +void RosterController::handleRosterSetError(ErrorPayload::ref error, boost::shared_ptr<RosterPayload> rosterPayload) { if (!error) { return; } diff --git a/Swift/Controllers/RosterController.h b/Swift/Controllers/RosterController.h index be9e407..2b1793e 100644 --- a/Swift/Controllers/RosterController.h +++ b/Swift/Controllers/RosterController.h @@ -58,7 +58,7 @@ namespace Swift { void handleSubscriptionRequestAccepted(SubscriptionRequestEvent* event); void handleSubscriptionRequestDeclined(SubscriptionRequestEvent* event); void handleUIEvent(boost::shared_ptr<UIEvent> event); - void handleRosterSetError(boost::optional<ErrorPayload> error, boost::shared_ptr<RosterPayload> rosterPayload); + void handleRosterSetError(ErrorPayload::ref error, boost::shared_ptr<RosterPayload> rosterPayload); void handleOwnNickChanged(const String& nick); void applyAllPresenceTo(const JID& jid); JID myJID_; |