diff options
Diffstat (limited to 'Swift/Controllers')
| -rw-r--r-- | Swift/Controllers/ProfileController.cpp | 10 | ||||
| -rw-r--r-- | Swift/Controllers/ProfileController.h | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/Swift/Controllers/ProfileController.cpp b/Swift/Controllers/ProfileController.cpp index be7b72c..7df8036 100644 --- a/Swift/Controllers/ProfileController.cpp +++ b/Swift/Controllers/ProfileController.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010 Isode Limited. | 2 | * Copyright (c) 2010-2015 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| @@ -8,12 +8,12 @@ | |||
| 8 | 8 | ||
| 9 | #include <boost/bind.hpp> | 9 | #include <boost/bind.hpp> |
| 10 | 10 | ||
| 11 | #include <Swiften/VCards/VCardManager.h> | ||
| 12 | |||
| 13 | #include <Swift/Controllers/Intl.h> | ||
| 11 | #include <Swift/Controllers/UIEvents/RequestProfileEditorUIEvent.h> | 14 | #include <Swift/Controllers/UIEvents/RequestProfileEditorUIEvent.h> |
| 12 | #include <Swift/Controllers/UIEvents/UIEventStream.h> | 15 | #include <Swift/Controllers/UIEvents/UIEventStream.h> |
| 13 | #include <Swift/Controllers/UIInterfaces/ProfileWindowFactory.h> | 16 | #include <Swift/Controllers/UIInterfaces/ProfileWindowFactory.h> |
| 14 | #include <Swiften/VCards/VCardManager.h> | ||
| 15 | #include <Swift/Controllers/Intl.h> | ||
| 16 | |||
| 17 | 17 | ||
| 18 | namespace Swift { | 18 | namespace Swift { |
| 19 | 19 | ||
| @@ -61,6 +61,7 @@ void ProfileController::handleSetVCardResponse(ErrorPayload::ref error) { | |||
| 61 | pendingSetVCardRequest.reset(); | 61 | pendingSetVCardRequest.reset(); |
| 62 | updateDialogStatus(); | 62 | updateDialogStatus(); |
| 63 | if (error) { | 63 | if (error) { |
| 64 | profileWindow->setVCard(vcardBeforeEdit); | ||
| 64 | profileWindow->setError(QT_TRANSLATE_NOOP("", "There was an error publishing your profile data")); | 65 | profileWindow->setError(QT_TRANSLATE_NOOP("", "There was an error publishing your profile data")); |
| 65 | } | 66 | } |
| 66 | else { | 67 | else { |
| @@ -72,6 +73,7 @@ void ProfileController::handleSetVCardResponse(ErrorPayload::ref error) { | |||
| 72 | void ProfileController::handleOwnVCardChanged(VCard::ref vcard) { | 73 | void ProfileController::handleOwnVCardChanged(VCard::ref vcard) { |
| 73 | if (profileWindow) { | 74 | if (profileWindow) { |
| 74 | profileWindow->setVCard(vcard); | 75 | profileWindow->setVCard(vcard); |
| 76 | vcardBeforeEdit = vcard; | ||
| 75 | gettingVCard = false; | 77 | gettingVCard = false; |
| 76 | updateDialogStatus(); | 78 | updateDialogStatus(); |
| 77 | } | 79 | } |
diff --git a/Swift/Controllers/ProfileController.h b/Swift/Controllers/ProfileController.h index 466834f..c6f5420 100644 --- a/Swift/Controllers/ProfileController.h +++ b/Swift/Controllers/ProfileController.h | |||
| @@ -1,16 +1,17 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010 Isode Limited. | 2 | * Copyright (c) 2010-2015 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #pragma once | 7 | #pragma once |
| 8 | 8 | ||
| 9 | #include <Swift/Controllers/UIEvents/UIEvent.h> | ||
| 10 | #include <Swiften/Elements/VCard.h> | ||
| 11 | #include <Swiften/Elements/ErrorPayload.h> | 9 | #include <Swiften/Elements/ErrorPayload.h> |
| 10 | #include <Swiften/Elements/VCard.h> | ||
| 12 | #include <Swiften/VCards/SetVCardRequest.h> | 11 | #include <Swiften/VCards/SetVCardRequest.h> |
| 13 | 12 | ||
| 13 | #include <Swift/Controllers/UIEvents/UIEvent.h> | ||
| 14 | |||
| 14 | namespace Swift { | 15 | namespace Swift { |
| 15 | class UIEventStream; | 16 | class UIEventStream; |
| 16 | class ProfileWindowFactory; | 17 | class ProfileWindowFactory; |
| @@ -40,6 +41,7 @@ namespace Swift { | |||
| 40 | SetVCardRequest::ref pendingSetVCardRequest; | 41 | SetVCardRequest::ref pendingSetVCardRequest; |
| 41 | ProfileWindow* profileWindow; | 42 | ProfileWindow* profileWindow; |
| 42 | bool gettingVCard; | 43 | bool gettingVCard; |
| 44 | VCard::ref vcardBeforeEdit; | ||
| 43 | }; | 45 | }; |
| 44 | } | 46 | } |
| 45 | 47 | ||
Swift