KPeople 5.109.0
Static Public Member Functions | List of all members
KPeople::PersonPluginManager

This class allows applications to manage DataSource plugins. More...

#include <personpluginmanager.h>

Static Public Member Functions

static bool addContact (const QVariantMap &properties)
 Creates a contact with the specified properties.
 
static void addDataSource (const QString &sourceId, BasePersonsDataSource *source)
 Adds custom data source.
 
static BasePersonsDataSource * dataSource (const QString &sourceId)
 
static QList< BasePersonsDataSource * > dataSourcePlugins ()
 
static bool deleteContact (const QString &uri)
 Deletes a contact with the specified &p uri.
 
static void setAutoloadDataSourcePlugins (bool autoloadDataSourcePlugins)
 Use this if you explicitly don't want KPeople to autoload all the available data source plugins.
 
static void setDataSourcePlugins (const QHash< QString, BasePersonsDataSource * > &dataSources)
 Instead of loading datasources from plugins, set sources manually This is for unit tests only.
 

Detailed Description

This class allows applications to manage DataSource plugins.

It can be useful if an application wants to use custom DataSource, without exposing it to other KPeople-based applications (i.e. without installing a system-wide plugin)

Another use-case is that it allows to pass custom arguments to DataSources (i.e. an ItemModel which will be used as a source of data)

Since
5.51

Member Function Documentation

◆ addContact()

static bool KPeople::PersonPluginManager::addContact ( const QVariantMap &  properties)
static

Creates a contact with the specified properties.

Returns
if it could be done successfully
Since
5.62

◆ addDataSource()

static void KPeople::PersonPluginManager::addDataSource ( const QString &  sourceId,
BasePersonsDataSource *  source 
)
static

Adds custom data source.

If DataSource with such sourceId was already loaded, we override it

Takes ownership of the source

◆ deleteContact()

static bool KPeople::PersonPluginManager::deleteContact ( const QString &  uri)
static

Deletes a contact with the specified &p uri.

Returns
if it could be done successfully
Since
5.62

◆ setAutoloadDataSourcePlugins()

static void KPeople::PersonPluginManager::setAutoloadDataSourcePlugins ( bool  autoloadDataSourcePlugins)
static

Use this if you explicitly don't want KPeople to autoload all the available data source plugins.

The default behavior is to autoload them

◆ setDataSourcePlugins()

static void KPeople::PersonPluginManager::setDataSourcePlugins ( const QHash< QString, BasePersonsDataSource * > &  dataSources)
static

Instead of loading datasources from plugins, set sources manually This is for unit tests only.