From 03289e653e5eedec2a63c76f902026e2112ffe02 Mon Sep 17 00:00:00 2001 From: Matt Vogt Date: Tue, 29 Oct 2013 16:46:16 +1000 Subject: [PATCH] [nemo-qml-plugin-contacts] Allow Person to be unresolved Revert to previous state, prior to resolving a match detail. --- src/seasideperson.cpp | 12 ++++++++++++ src/seasideperson.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/seasideperson.cpp b/src/seasideperson.cpp index af03cf8..24a20ae 100644 --- a/src/seasideperson.cpp +++ b/src/seasideperson.cpp @@ -1955,6 +1955,18 @@ void SeasidePerson::resetContactData() } } +void SeasidePerson::unresolve(const QVariant &data) +{ + QVariant previousData(contactData()); + + setContactData(data); + mContact->setId(QContactId()); + mComplete = true; + + updateContactDetails(previousData.value()); + emit contactChanged(); +} + QString SeasidePerson::vCard() const { QVersitContactExporter exporter; diff --git a/src/seasideperson.h b/src/seasideperson.h index 8ef8678..3e70fa5 100644 --- a/src/seasideperson.h +++ b/src/seasideperson.h @@ -317,6 +317,8 @@ class SeasidePerson Q_INVOKABLE void resolveEmailAddress(const QString &address, bool requireComplete = true); Q_INVOKABLE void resolveOnlineAccount(const QString &localUid, const QString &remoteUid, bool requireComplete = true); + Q_INVOKABLE void unresolve(const QVariant &data); + Q_INVOKABLE static QVariantList removeDuplicatePhoneNumbers(const QVariantList &phoneNumbers); Q_INVOKABLE static QVariantList removeDuplicateOnlineAccounts(const QVariantList &onlineAccounts); Q_INVOKABLE static QVariantList removeDuplicateEmailAddresses(const QVariantList &emailAddresses);