KCModuleLoader
Enumerations | |
enum | ErrorReporting { None = 0, Inline = 1, Dialog = 2, Both = 3 } |
Functions | |
KCMUTILS_EXPORT bool | isDefaults (const KCModuleInfo &module, const QStringList &args=QStringList()) |
KCMUTILS_EXPORT KCModule * | loadModule (const KCModuleInfo &module, ErrorReporting report, QWidget *parent=nullptr, const QStringList &args=QStringList()) |
KCMUTILS_EXPORT KCModule * | loadModule (const KPluginMetaData &metaData, QWidget *parent=nullptr, const QVariantList &args={}) |
KCMUTILS_EXPORT KCModule * | loadModule (const QString &module, ErrorReporting report, QWidget *parent=nullptr, const QStringList &args=QStringList()) |
KCMUTILS_EXPORT KCModuleData * | loadModuleData (const KCModuleInfo &module, const QStringList &args=QStringList()) |
KCMUTILS_EXPORT KCModule * | reportError (ErrorReporting report, const QString &text, const QString &details, QWidget *parent) |
KCMUTILS_EXPORT void | unloadModule (const KCModuleInfo &mod) |
Detailed Description
Loads a KControl Module.
KCModuleLoader tries in several ways to locate and load a KCModule. If loading fails a zero pointer is returned.
It is very unlikely KCModuleLoader is what you want and KCModuleProxy suits your needs.
Enumeration Type Documentation
◆ ErrorReporting
Determines the way errors are reported.
Enumerator | |
---|---|
None | no error reporting is done |
Inline | the error report is shown instead of the KCModule that should have * been loaded |
Dialog | shows a dialog with the error report |
Both | does both Inline and Dialog |
Definition at line 40 of file kcmoduleloader.h.
Function Documentation
◆ isDefaults()
bool KCModuleLoader::isDefaults | ( | const KCModuleInfo & | module, |
const QStringList & | args = QStringList() |
||
) |
For a specified module, return false if configuration is not the default one and true in all other case including if module is not found.
- Parameters
-
module what module to load
- Returns
- a boolean representing if module configuration is in default state
- Since
- 5.74
- Deprecated:
- Since 5.88, use KPluginFactory::instantiatePlugin<KCModuleData> and save the result in a QScopedPointer instead
Definition at line 248 of file kcmoduleloader.cpp.
◆ loadModule() [1/3]
KCModule * KCModuleLoader::loadModule | ( | const KCModuleInfo & | module, |
ErrorReporting | report, | ||
QWidget * | parent = nullptr , |
||
const QStringList & | args = QStringList() |
||
) |
Loads a KCModule.
If loading fails a zero pointer is returned.
- Parameters
-
module what module to load report see ErrorReporting
- Returns
- a pointer to the loaded KCModule
- Deprecated:
- Since 5.88, use loadModule(KPluginMetaData, QWidget *, QVariantList) instead
Definition at line 143 of file kcmoduleloader.cpp.
◆ loadModule() [2/3]
KCModule * KCModuleLoader::loadModule | ( | const KPluginMetaData & | metaData, |
QWidget * | parent = nullptr , |
||
const QVariantList & | args = {} |
||
) |
Loads a KCModule.
If loading fails a KCM which displays an error message is returned. Starting from 5.91, the validity of the metaData
parameter does not need to be checked when calling this function.
- Parameters
-
metaData KPluginMetaData for loading the plugin
- Returns
- a pointer to the loaded KCModule
- Since
- 5.84
Definition at line 53 of file kcmoduleloader.cpp.
◆ loadModule() [3/3]
QT_WARNING_PUSH KCModule * KCModuleLoader::loadModule | ( | const QString & | module, |
ErrorReporting | report, | ||
QWidget * | parent = nullptr , |
||
const QStringList & | args = QStringList() |
||
) |
Loads a KCModule.
If loading fails a zero pointer is returned.
- Parameters
-
module what module to load report see ErrorReporting
- Returns
- a pointer to the loaded KCModule
- Deprecated:
- Since 5.88, use loadModule(KPluginMetaData, QWidget *, QVariantList) instead
Definition at line 138 of file kcmoduleloader.cpp.
◆ loadModuleData()
KCModuleData * KCModuleLoader::loadModuleData | ( | const KCModuleInfo & | module, |
const QStringList & | args = QStringList() |
||
) |
Loads a KCModuleData.
If fails to load, return nullptr.
- Parameters
-
module what module to load
- Since
- 5.81
- Deprecated:
- Since 5.88, use KPluginFactory::instantiatePlugin<KCModuleData> instead
Definition at line 258 of file kcmoduleloader.cpp.
◆ reportError()
KCModule * KCModuleLoader::reportError | ( | ErrorReporting | report, |
const QString & | text, | ||
const QString & | details, | ||
QWidget * | parent | ||
) |
Returns a KCModule containing the messages report
and text
.
- Parameters
-
report the type of error reporting, see ErrorReporting text the main message details any additional details
Definition at line 114 of file kcmoduleloader.cpp.
◆ unloadModule()
void KCModuleLoader::unloadModule | ( | const KCModuleInfo & | mod | ) |
Unloads the module's library.
- Parameters
-
mod What module to unload for
- Deprecated:
- Since 5.88, use QPluginLoader directly
Definition at line 241 of file kcmoduleloader.cpp.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 3 2023 03:53:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.