KPeople
20 #include "basepersonsdatasource.h"
24 #include "backends/abstractcontact.h"
25 #include "defaultcontactmonitor_p.h"
29 class KPeople::BasePersonsDataSourcePrivate
32 QWeakPointer<AllContactsMonitor> m_allContactsMonitor;
33 QHash<QString, QWeakPointer<ContactMonitor> > m_contactMonitors;
36 BasePersonsDataSource::BasePersonsDataSource(QObject *parent,
const QVariantList &args)
38 d_ptr(new BasePersonsDataSourcePrivate)
43 BasePersonsDataSource::~BasePersonsDataSource()
48 AllContactsMonitorPtr BasePersonsDataSource::allContactsMonitor()
50 Q_D(BasePersonsDataSource);
53 AllContactsMonitorPtr c;
54 if (!d->m_allContactsMonitor.toStrongRef()) {
55 c = AllContactsMonitorPtr(createAllContactsMonitor());
56 d->m_allContactsMonitor = c;
59 return d->m_allContactsMonitor.toStrongRef();
62 ContactMonitorPtr BasePersonsDataSource::contactMonitor(
const QString &contactUri)
64 Q_D(BasePersonsDataSource);
67 if (!d->m_contactMonitors[contactUri].toStrongRef()) {
68 c = ContactMonitorPtr(createContactMonitor(contactUri));
69 d->m_contactMonitors[contactUri] = c;
71 return d->m_contactMonitors[contactUri].toStrongRef();
74 ContactMonitor *BasePersonsDataSource::createContactMonitor(
const QString &contactUri)
76 return new DefaultContactMonitor(contactUri, allContactsMonitor());
The KPeople namespace contains all the classes for Libkpeople.
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Fri Feb 13 2015 15:16:39 by
doxygen 1.8.9.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.