KPeople
8#include "basepersonsdatasource.h"
10#include "backends/abstractcontact.h"
11#include "defaultcontactmonitor_p.h"
13using namespace KPeople;
15class KPeople::BasePersonsDataSourcePrivate
18 QWeakPointer<AllContactsMonitor> m_allContactsMonitor;
19 QHash<QString, QWeakPointer<ContactMonitor>> m_contactMonitors;
22BasePersonsDataSource::BasePersonsDataSource(
QObject *parent,
const QVariantList &args)
24 , d_ptr(new BasePersonsDataSourcePrivate)
29BasePersonsDataSource::~BasePersonsDataSource()
34AllContactsMonitorPtr BasePersonsDataSource::allContactsMonitor()
36 Q_D(BasePersonsDataSource);
39 AllContactsMonitorPtr c = d->m_allContactsMonitor.toStrongRef();
41 c = AllContactsMonitorPtr(createAllContactsMonitor());
42 d->m_allContactsMonitor = c;
48ContactMonitorPtr BasePersonsDataSource::contactMonitor(
const QString &contactUri)
50 Q_D(BasePersonsDataSource);
52 ContactMonitorPtr c = d->m_contactMonitors[contactUri].toStrongRef();
54 c = ContactMonitorPtr(createContactMonitor(contactUri));
55 d->m_contactMonitors[contactUri] = c;
60ContactMonitor *BasePersonsDataSource::createContactMonitor(
const QString &contactUri)
62 return new DefaultContactMonitor(contactUri, allContactsMonitor());
65BasePersonsDataSourceV2::BasePersonsDataSourceV2(QObject *parent,
const QVariantList &args)
66 : BasePersonsDataSource(parent, args)
70#include "moc_basepersonsdatasource.cpp"
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:51:57 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.