Skip to content

Commit 6c79e46

Browse files
committed
[nemo-qml-plugin-contacts] Allow Person to be unresolved
Revert to previous state, prior to resolving a match detail.
1 parent e5220b9 commit 6c79e46

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/seasideperson.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,18 @@ void SeasidePerson::resetContactData()
15971597
}
15981598
}
15991599

1600+
void SeasidePerson::unresolve(const QVariant &data)
1601+
{
1602+
QVariant previousData(contactData());
1603+
1604+
setContactData(data);
1605+
mContact->setId(QContactId());
1606+
mComplete = true;
1607+
1608+
updateContactDetails(previousData.value<QContact>());
1609+
emit contactChanged();
1610+
}
1611+
16001612
QString SeasidePerson::vCard() const
16011613
{
16021614
QVersitContactExporter exporter;

src/seasideperson.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ class SeasidePerson
331331
Q_INVOKABLE void resolveEmailAddress(const QString &address, bool requireComplete = true);
332332
Q_INVOKABLE void resolveOnlineAccount(const QString &localUid, const QString &remoteUid, bool requireComplete = true);
333333

334+
Q_INVOKABLE void unresolve(const QVariant &data);
335+
334336
void displayLabelOrderChanged(SeasideCache::DisplayLabelOrder order);
335337

336338
void updateContact(const QContact &newContact, QContact *oldContact, SeasideCache::ContactState state);

0 commit comments

Comments
 (0)