diff options
Diffstat (limited to 'Swift/Controllers/ProfileController.cpp')
-rw-r--r-- | Swift/Controllers/ProfileController.cpp | 10 |
1 files changed, 6 insertions, 4 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,22 +1,22 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swift/Controllers/ProfileController.h> #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 { ProfileController::ProfileController(VCardManager* vcardManager, ProfileWindowFactory* profileWindowFactory, UIEventStream* uiEventStream) : vcardManager(vcardManager), profileWindowFactory(profileWindowFactory), uiEventStream(uiEventStream), available(true), profileWindow(NULL), gettingVCard(false) { uiEventStream->onUIEvent.connect(boost::bind(&ProfileController::handleUIEvent, this, _1)); } @@ -58,23 +58,25 @@ void ProfileController::handleVCardChangeRequest(VCard::ref vcard) { } 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 { profileWindow->setError(""); profileWindow->hide(); } } void ProfileController::handleOwnVCardChanged(VCard::ref vcard) { if (profileWindow) { profileWindow->setVCard(vcard); + vcardBeforeEdit = vcard; gettingVCard = false; updateDialogStatus(); } } void ProfileController::handleProfileWindowAboutToBeClosed(const JID&) { |