Changeset View
Changeset View
Standalone View
Standalone View
src/persondata.cpp
Show All 18 Lines | |||||
19 | #include "persondata.h" | 19 | #include "persondata.h" | ||
20 | 20 | | |||
21 | #include "metacontact_p.h" | 21 | #include "metacontact_p.h" | ||
22 | #include "personmanager_p.h" | 22 | #include "personmanager_p.h" | ||
23 | #include "personpluginmanager.h" | 23 | #include "personpluginmanager.h" | ||
24 | #include "backends/basepersonsdatasource.h" | 24 | #include "backends/basepersonsdatasource.h" | ||
25 | #include "backends/contactmonitor.h" | 25 | #include "backends/contactmonitor.h" | ||
26 | #include "backends/abstractcontact.h" | 26 | #include "backends/abstractcontact.h" | ||
27 | #include "backends/abstracteditablecontact.h" | ||||
27 | 28 | | |||
28 | #include <QUrl> | 29 | #include <QUrl> | ||
29 | #include "kpeople_debug.h" | 30 | #include "kpeople_debug.h" | ||
30 | #include <QStandardPaths> | 31 | #include <QStandardPaths> | ||
31 | 32 | | |||
32 | namespace KPeople | 33 | namespace KPeople | ||
33 | { | 34 | { | ||
34 | class PersonDataPrivate | 35 | class PersonDataPrivate | ||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Line(s) | 137 | { | |||
150 | return avatar; | 151 | return avatar; | ||
151 | } | 152 | } | ||
152 | QVariant PersonData::contactCustomProperty(const QString &key) const | 153 | QVariant PersonData::contactCustomProperty(const QString &key) const | ||
153 | { | 154 | { | ||
154 | Q_D(const PersonData); | 155 | Q_D(const PersonData); | ||
155 | return d->metaContact.personAddressee()->customProperty(key); | 156 | return d->metaContact.personAddressee()->customProperty(key); | ||
156 | } | 157 | } | ||
157 | 158 | | |||
159 | bool KPeople::PersonData::setContactCustomProperty(const QString& key, const QVariant& value) | ||||
160 | { | ||||
161 | Q_D(PersonData); | ||||
162 | auto contact = dynamic_cast<AbstractEditableContact*>(d->metaContact.personAddressee().data()); | ||||
163 | | ||||
164 | return contact && contact->setCustomProperty(key, value); | ||||
165 | } | ||||
166 | | ||||
158 | QString PersonData::presenceIconName() const | 167 | QString PersonData::presenceIconName() const | ||
159 | { | 168 | { | ||
160 | QString contactPresence = contactCustomProperty(QStringLiteral("telepathy-presence")).toString(); | 169 | QString contactPresence = contactCustomProperty(QStringLiteral("telepathy-presence")).toString(); | ||
161 | return KPeople::iconNameForPresenceString(contactPresence); | 170 | return KPeople::iconNameForPresenceString(contactPresence); | ||
162 | } | 171 | } | ||
163 | 172 | | |||
164 | QString PersonData::name() const | 173 | QString PersonData::name() const | ||
165 | { | 174 | { | ||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |