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 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,12 +8,12 @@ #include <boost/bind.hpp> +#include <Swiften/VCards/VCardManager.h> + +#include <Swift/Controllers/Intl.h> #include <Swift/Controllers/UIEvents/RequestProfileEditorUIEvent.h> #include <Swift/Controllers/UIEvents/UIEventStream.h> #include <Swift/Controllers/UIInterfaces/ProfileWindowFactory.h> -#include <Swiften/VCards/VCardManager.h> -#include <Swift/Controllers/Intl.h> - namespace Swift { @@ -61,6 +61,7 @@ void ProfileController::handleSetVCardResponse(ErrorPayload::ref error) { pendingSetVCardRequest.reset(); updateDialogStatus(); if (error) { + profileWindow->setVCard(vcardBeforeEdit); profileWindow->setError(QT_TRANSLATE_NOOP("", "There was an error publishing your profile data")); } else { @@ -72,6 +73,7 @@ void ProfileController::handleSetVCardResponse(ErrorPayload::ref error) { void ProfileController::handleOwnVCardChanged(VCard::ref vcard) { if (profileWindow) { profileWindow->setVCard(vcard); + vcardBeforeEdit = vcard; gettingVCard = false; updateDialogStatus(); } 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 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <Swift/Controllers/UIEvents/UIEvent.h> -#include <Swiften/Elements/VCard.h> #include <Swiften/Elements/ErrorPayload.h> +#include <Swiften/Elements/VCard.h> #include <Swiften/VCards/SetVCardRequest.h> +#include <Swift/Controllers/UIEvents/UIEvent.h> + namespace Swift { class UIEventStream; class ProfileWindowFactory; @@ -40,6 +41,7 @@ namespace Swift { SetVCardRequest::ref pendingSetVCardRequest; ProfileWindow* profileWindow; bool gettingVCard; + VCard::ref vcardBeforeEdit; }; } |