diff --git a/src/kpeoplevcard.h b/src/kpeoplevcard.h --- a/src/kpeoplevcard.h +++ b/src/kpeoplevcard.h @@ -24,6 +24,8 @@ #include #include +#include + class Q_DECL_EXPORT KPeopleVCard : public KPeople::AllContactsMonitor { Q_OBJECT @@ -43,4 +45,8 @@ KDirWatch* m_fs; }; +// This probably will not be needed in the future since it should already be handled +// by newer (> 19.04) versions of KContacts +Q_DECLARE_METATYPE(KContacts::PhoneNumber) + #endif diff --git a/src/kpeoplevcard.cpp b/src/kpeoplevcard.cpp --- a/src/kpeoplevcard.cpp +++ b/src/kpeoplevcard.cpp @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include @@ -68,6 +70,16 @@ return numbers; } else if (key == PhoneNumberProperty) { return m_addressee.phoneNumbers().isEmpty() ? QVariant() : m_addressee.phoneNumbers().at(0).number(); + } else if (key == KContactPhoneNumberProperty) { + m_addressee.phoneNumbers().value(0); + } else if (key == KContactAllPhoneNumbersProperty) { + QVariantList numbers; + Q_FOREACH (const KContacts::PhoneNumber &phoneNumber, m_addressee.phoneNumbers()) { + QVariant var; + var.setValue(phoneNumber); + numbers += var; + } + return numbers; } return ret;