KPeople
personsmodel.cpp
37 // NOTE This is the opposite way round to the return value from contactMapping() for easier lookups
58 QVariant dataForContact(const QString &personUri, const AbstractContact::Ptr &contact, int role) const;
87 QMetaObject::invokeMethod(d, "onMonitorInitialFetchComplete", Qt::QueuedConnection, Q_ARG(bool, monitor->initialFetchSuccess()));
89 connect(monitor.data(), &AllContactsMonitor::initialFetchComplete, d, &PersonsModelPrivate::onMonitorInitialFetchComplete);
95 connect(PersonManager::instance(), &PersonManager::contactAddedToPerson, d, &PersonsModelPrivate::onAddContactToPerson);
96 connect(PersonManager::instance(), &PersonManager::contactRemovedFromPerson, d, &PersonsModelPrivate::onRemoveContactsFromPerson);
142QVariant PersonsModelPrivate::dataForContact(const QString &personUri, const AbstractContact::Ptr &person, int role) const
175 return QVariant::fromValue<AbstractContact::List>(metacontacts[personIndex[personUri].row()].contacts());
283 connect(monitor.data(), &AllContactsMonitor::contactAdded, this, &PersonsModelPrivate::onContactAdded);
284 connect(monitor.data(), &AllContactsMonitor::contactChanged, this, &PersonsModelPrivate::onContactChanged);
285 connect(monitor.data(), &AllContactsMonitor::contactRemoved, this, &PersonsModelPrivate::onContactRemoved);
289void PersonsModelPrivate::onContactAdded(const QString &contactUri, const AbstractContact::Ptr &contact)
300 qCWarning(KPEOPLE_LOG) << "Source emitted contactAdded for a contact we already know about " << contactUri;
316void PersonsModelPrivate::onContactChanged(const QString &contactUri, const AbstractContact::Ptr &contact)
349void PersonsModelPrivate::onAddContactToPerson(const QString &contactUri, const QString &newPersonUri)
378 QHash<QString, QPersistentModelIndex>::const_iterator pidx = personIndex.constFind(newPersonUri);
static const QString PhoneNumberProperty
String property representing the preferred phone number of the contact.
Definition abstractcontact.h:43
static const QString NameProperty
String property representing the display name of the contact.
Definition abstractcontact.h:37
static const QString PictureProperty
QUrl or QPixmap property representing the contacts' avatar.
Definition abstractcontact.h:57
void contactRemoved(const QString &contactUri)
DataSources should emit this whenever a contact is removed and they are no longer able to supply up-t...
void contactAdded(const QString &contactUri, const KPeople::AbstractContact::Ptr &contact)
DataSources should emit this whenever a contact is added.
void contactChanged(const QString &contactUri, const KPeople::AbstractContact::Ptr &contact)
DataSources should emit this whenever a known contact changes.
void initialFetchComplete(bool success)
Notifies that the DataSource has completed it's initial fetch.
This class creates a model of all known contacts from all sources Contacts are represented as a tree ...
Definition personsmodel.h:34
void modelInitialized(bool success)
Will emit when the model is finally initialized.
Q_SCRIPTABLE QVariant get(int row, int role)
Helper class to ease model access through QML.
Definition personsmodel.cpp:469
QModelIndex indexForPersonUri(const QString &personUri) const
Definition personsmodel.cpp:463
bool isInitialized
specifies whether the model has already been initialized
Definition personsmodel.h:37
@ PhotoImageProviderUri
Provide a URL to use with QtQuick's Image.source, similar to the Photo Role.
Definition personsmodel.h:48
QVariant contactCustomProperty(const QModelIndex &index, const QString &key) const
Makes it possible to access custom properties that are not available to the model.
Definition personsmodel.cpp:474
void beginInsertRows(const QModelIndex &parent, int first, int last)
void beginRemoveRows(const QModelIndex &parent, int first, int last)
QModelIndex createIndex(int row, int column, const void *ptr) const const
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
void endInsertRows()
void endRemoveRows()
virtual QHash< int, QByteArray > roleNames() const const
const_iterator constEnd() const const
const_iterator constFind(const Key &key) const const
iterator insert(const Key &key, const T &value)
bool remove(const Key &key)
T value(const Key &key) const const
bool isNull() const const
void append(QList< T > &&value)
void removeAt(qsizetype i)
qsizetype size() const const
const_iterator constBegin() const const
const_iterator constEnd() const const
iterator insert(const Key &key, const T &value)
bool isEmpty() const const
T take(const Key &key)
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
quintptr internalId() const const
bool isValid() const const
QModelIndex parent() const const
int row() const const
QList< Key > uniqueKeys() const const
QList< T > values() const const
Q_EMITQ_EMIT
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
QVariant data(int role) const const
bool isValid() const const
int row() const const
bool isNull() const const
QueuedConnection
UserRole
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
bool isLocalFile() const const
QString toLocalFile() const const
bool canConvert() const const
QVariant fromValue(T &&value)
QUrl toUrl() const const
T value() const const
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.