diff options
author | Tobias Markmann <tm@ayena.de> | 2015-06-09 21:29:20 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-07-07 13:00:23 (GMT) |
commit | 2598ef4efcd74d5e9e701c62337bf84829572508 (patch) | |
tree | c60d7337a9f8932ed4a1d70e606d1ce2787f866f /Swift/QtUI | |
parent | f10c9618f8ccd9e44c9a45a69179883b39a445f5 (diff) | |
download | swift-2598ef4efcd74d5e9e701c62337bf84829572508.zip swift-2598ef4efcd74d5e9e701c62337bf84829572508.tar.bz2 |
Show old vCard in UI if vCard update is rejected by server
Previously QtVCardWidget would work on a shared copy of a VCard and
modify the shared version. Now when setting the vCard on the widget
it creates its own copy and works on that.
The ProfileController holds a reference to the VCard it sets on the UI.
If the server rejects an update it can reset the UI to this VCard.
Test-Information:
Tested against a XMPP server that rejects all vCard updates
(mod_readonly).
Change-Id: Iaa8eed6406f2dc6cc7ac5434194a7dae4f879b33
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp b/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp index 79360d8..ac087ed 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp +++ b/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp @@ -13,7 +13,6 @@ #include <Swift/QtUI/QtVCardWidget/QtVCardWidget.h> #include <Swift/QtUI/QtVCardWidget/ui_QtVCardWidget.h> -#include <QDebug> #include <QLineEdit> #include <QMenu> @@ -112,7 +111,7 @@ void QtVCardWidget::setEditable(bool editable) { void QtVCardWidget::setVCard(VCard::ref vcard) { clearFields(); - this->vcard = vcard; + this->vcard = boost::make_shared<VCard>(*vcard); ui->photoAndName->setFormattedName(P2QSTRING(vcard->getFullName())); ui->photoAndName->setNickname(P2QSTRING(vcard->getNickname())); ui->photoAndName->setPrefix(P2QSTRING(vcard->getPrefix())); |