Krita Source Code Documentation
Loading...
Searching...
No Matches
KoDockRegistry Class Reference

#include <KoDockRegistry.h>

+ Inheritance diagram for KoDockRegistry:

Public Member Functions

 KoDockRegistry ()
 
 ~KoDockRegistry () override
 
- Public Member Functions inherited from KoGenericRegistry< KoDockFactoryBase * >
void add (const QString &id, KoDockFactoryBase * item)
 
void add (KoDockFactoryBase * item)
 
void addAlias (const QString &alias, const QString &id)
 
QHash< QString, KoDockFactoryBase * >::const_iterator constBegin () const
 
QHash< QString, KoDockFactoryBase * >::const_iterator constEnd () const
 
bool contains (const QString &id) const
 
int count () const
 
QList< KoDockFactoryBase * > doubleEntries () const
 
KoDockFactoryBaseget (const QString &id) const
 
QList< QString > keys () const
 
 KoGenericRegistry ()
 
void remove (const QString &id)
 
void removeAlias (const QString &alias)
 
const KoDockFactoryBasevalue (const QString &id) const
 
QList< KoDockFactoryBase * > values () const
 
virtual ~KoGenericRegistry ()
 

Static Public Member Functions

static KoDockRegistryinstance ()
 

Private Member Functions

void init ()
 
 KoDockRegistry (const KoDockRegistry &)
 
KoDockRegistry operator= (const KoDockRegistry &)
 

Private Attributes

Private *const d
 

Detailed Description

This singleton class keeps a register of all available dockers, or rather, of the factories that can create the QDockWidget instances for the mainwindows. Note that adding your KoDockFactoryBase to this registry will mean it will automatically be added to an application, no extra code is required for that.

See also
KoCanvasObserverBase

Definition at line 25 of file KoDockRegistry.h.

Constructor & Destructor Documentation

◆ KoDockRegistry() [1/2]

KoDockRegistry::KoDockRegistry ( )

Definition at line 20 of file KoDockRegistry.cpp.

21 : d(0)
22{
23}
Private *const d

◆ ~KoDockRegistry()

KoDockRegistry::~KoDockRegistry ( )
override

Definition at line 34 of file KoDockRegistry.cpp.

35{
36 Q_FOREACH(const KoDockFactoryBase *a, values()) {
37 delete a;
38 }
39}
QList< KoDockFactoryBase * > values() const

References KoGenericRegistry< KoDockFactoryBase * >::values().

◆ KoDockRegistry() [2/2]

KoDockRegistry::KoDockRegistry ( const KoDockRegistry & )
private

Member Function Documentation

◆ init()

void KoDockRegistry::init ( )
private

Definition at line 25 of file KoDockRegistry.cpp.

26{
28 config.blacklist = "DockerPluginsDisabled";
29 config.group = "krita";
30 KoPluginLoader::instance()->load(QString::fromLatin1("Krita/Dock"),
31 config);
32}
void load(const QString &serviceType, const PluginsConfig &config=PluginsConfig(), QObject *owner=0, bool cache=true)
static KoPluginLoader * instance()
const char * blacklist
This contains the variable name for the list of plugins (by library name) that will not be loaded.

References KoPluginLoader::PluginsConfig::blacklist, KoPluginLoader::PluginsConfig::group, KoPluginLoader::instance(), and KoPluginLoader::load().

◆ instance()

KoDockRegistry * KoDockRegistry::instance ( )
static

Return an instance of the KoDockRegistry Create a new instance on first call and return the singleton.

Definition at line 41 of file KoDockRegistry.cpp.

42{
43
44 if (!s_instance.exists()) {
45 s_instance->init();
46 }
47 return s_instance;
48}

References init().

◆ operator=()

KoDockRegistry KoDockRegistry::operator= ( const KoDockRegistry & )
private

Member Data Documentation

◆ d

Private* const KoDockRegistry::d
private

Definition at line 44 of file KoDockRegistry.h.


The documentation for this class was generated from the following files: