Skip to content

Commit

Permalink
[nemo-qml-plugin-contacts] Allow Person to be unresolved
Browse files Browse the repository at this point in the history
Revert to previous state, prior to resolving a match detail.
  • Loading branch information
matthewvogt committed Oct 29, 2013
1 parent e5220b9 commit 6c79e46
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/seasideperson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,18 @@ void SeasidePerson::resetContactData()
}
}

void SeasidePerson::unresolve(const QVariant &data)
{
QVariant previousData(contactData());

setContactData(data);
mContact->setId(QContactId());
mComplete = true;

updateContactDetails(previousData.value<QContact>());
emit contactChanged();
}

QString SeasidePerson::vCard() const
{
QVersitContactExporter exporter;
Expand Down
2 changes: 2 additions & 0 deletions src/seasideperson.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,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);

void displayLabelOrderChanged(SeasideCache::DisplayLabelOrder order);

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

0 comments on commit 6c79e46

Please sign in to comment.