diff --git a/src/backends/abstractcontact.h b/src/backends/abstractcontact.h --- a/src/backends/abstractcontact.h +++ b/src/backends/abstractcontact.h @@ -45,6 +45,12 @@ virtual ~AbstractContact(); // well-known properties + /** String property representing the first name of the contact */ + static const QString FirstNameProperty; + + /** String property representing the last name of the contact */ + static const QString LastNameProperty; + /** String property representing the display name of the contact */ static const QString NameProperty; diff --git a/src/backends/abstractcontact.cpp b/src/backends/abstractcontact.cpp --- a/src/backends/abstractcontact.cpp +++ b/src/backends/abstractcontact.cpp @@ -20,6 +20,8 @@ using namespace KPeople; +const QString AbstractContact::FirstNameProperty = QStringLiteral("firstName"); +const QString AbstractContact::LastNameProperty = QStringLiteral("lastName"); const QString AbstractContact::NameProperty = QStringLiteral("name"); const QString AbstractContact::EmailProperty = QStringLiteral("email"); const QString AbstractContact::PhoneNumberProperty = QStringLiteral("phoneNumber"); diff --git a/src/persondata.h b/src/persondata.h --- a/src/persondata.h +++ b/src/persondata.h @@ -73,6 +73,16 @@ */ QStringList contactUris() const; + /** + * @returns the first name of the person + */ + QString firstName() const; + + /** + * @returns the last name of the person + */ + QString lastName() const; + /** * @returns the name of the person */ diff --git a/src/persondata.cpp b/src/persondata.cpp --- a/src/persondata.cpp +++ b/src/persondata.cpp @@ -161,6 +161,16 @@ return KPeople::iconNameForPresenceString(contactPresence); } +QString PersonData::firstName() const +{ + return contactCustomProperty(AbstractContact::FirstNameProperty).toString(); +} + +QString PersonData::lastName() const +{ + return contactCustomProperty(AbstractContact::LastNameProperty).toString(); +} + QString PersonData::name() const { return contactCustomProperty(AbstractContact::NameProperty).toString();