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 /Swiften/Queries/Requests | |
parent | 5caf2316dad81d6c02ff3e886a65121011ccc9fe (diff) | |
download | swift-contrib-f4e2f1deecd322e859bfb27bc5a9ab97726481c5.zip swift-contrib-f4e2f1deecd322e859bfb27bc5a9ab97726481c5.tar.bz2 |
Change error from optional to shared_ptr in GenericRequest
Resolves: #692
Diffstat (limited to 'Swiften/Queries/Requests')
4 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Queries/Requests/GetPrivateStorageRequest.h b/Swiften/Queries/Requests/GetPrivateStorageRequest.h index b593495..f0b95d8 100644 --- a/Swiften/Queries/Requests/GetPrivateStorageRequest.h +++ b/Swiften/Queries/Requests/GetPrivateStorageRequest.h @@ -27,7 +27,7 @@ namespace Swift { GetPrivateStorageRequest(IQRouter* router) : Request(IQ::Get, JID(), boost::shared_ptr<PrivateStorage>(new PrivateStorage(boost::shared_ptr<Payload>(new PAYLOAD_TYPE()))), router) { } - virtual void handleResponse(boost::shared_ptr<Payload> payload, boost::optional<ErrorPayload> error) { + virtual void handleResponse(boost::shared_ptr<Payload> payload, ErrorPayload::ref error) { boost::shared_ptr<PrivateStorage> storage = boost::dynamic_pointer_cast<PrivateStorage>(payload); if (storage) { onResponse(boost::dynamic_pointer_cast<PAYLOAD_TYPE>(storage->getPayload()), error); @@ -38,6 +38,6 @@ namespace Swift { } public: - boost::signal<void (boost::shared_ptr<PAYLOAD_TYPE>, const boost::optional<ErrorPayload>&)> onResponse; + boost::signal<void (boost::shared_ptr<PAYLOAD_TYPE>, ErrorPayload::ref)> onResponse; }; } diff --git a/Swiften/Queries/Requests/SetPrivateStorageRequest.h b/Swiften/Queries/Requests/SetPrivateStorageRequest.h index 1931f3a..69eb001 100644 --- a/Swiften/Queries/Requests/SetPrivateStorageRequest.h +++ b/Swiften/Queries/Requests/SetPrivateStorageRequest.h @@ -27,11 +27,11 @@ namespace Swift { SetPrivateStorageRequest(boost::shared_ptr<PAYLOAD_TYPE> payload, IQRouter* router) : Request(IQ::Set, JID(), boost::shared_ptr<PrivateStorage>(new PrivateStorage(payload)), router) { } - virtual void handleResponse(boost::shared_ptr<Payload>, boost::optional<ErrorPayload> error) { + virtual void handleResponse(boost::shared_ptr<Payload>, ErrorPayload::ref error) { onResponse(error); } public: - boost::signal<void (const boost::optional<ErrorPayload>&)> onResponse; + boost::signal<void (ErrorPayload::ref)> onResponse; }; } diff --git a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h index fb2d344..0700c65 100644 --- a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h +++ b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h @@ -26,11 +26,11 @@ namespace Swift { SetInBandRegistrationRequest(const JID& to, InBandRegistrationPayload::ref payload, IQRouter* router) : Request(IQ::Set, to, InBandRegistrationPayload::ref(payload), router) { } - virtual void handleResponse(Payload::ref payload, boost::optional<ErrorPayload> error) { + virtual void handleResponse(Payload::ref payload, ErrorPayload::ref error) { onResponse(payload, error); } public: - boost::signal<void (Payload::ref, const boost::optional<ErrorPayload>&)> onResponse; + boost::signal<void (Payload::ref, ErrorPayload::ref)> onResponse; }; } diff --git a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp index fe8b0a0..89cd7f1 100644 --- a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp +++ b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp @@ -78,7 +78,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture } private: - void handleResponse(boost::shared_ptr<Payload> p, const boost::optional<ErrorPayload>& e) { + void handleResponse(boost::shared_ptr<Payload> p, ErrorPayload::ref e) { if (e) { errors.push_back(*e); } |