KCModuleInfo

KCModuleInfo Class Reference

#include <kcmoduleinfo.h>

Public Member Functions

 KCModuleInfo (const QString &desktopFile)
 
 KCModuleInfo (const KPluginInfo &pluginInfo)
 
 KCModuleInfo (KService::Ptr moduleInfo)
 
 KCModuleInfo (const KCModuleInfo &rhs)
 
 KCModuleInfo ()
 
 ~KCModuleInfo ()
 
QString comment () const
 
QString docPath () const
 
QString fileName () const
 
QString handle () const
 
QString icon () const
 
bool isValid () const
 
QStringList keywords () const
 
QString library () const
 
QString moduleName () const
 
bool operator!= (const KCModuleInfo &rhs) const
 
KCModuleInfooperator= (const KCModuleInfo &rhs)
 
bool operator== (const KCModuleInfo &rhs) const
 
KPluginInfo pluginInfo () const
 
QVariant property (const QString &key) const
 
KService::Ptr service () const
 
int weight () const
 

Detailed Description

A class that provides information about a KCModule.

KCModuleInfo provides various technical information, such as icon, library etc. about a KCModule.n

Note
Any values set with the set* functions is not written back with KCModuleInfo it only reads value from the desktop file.
Author
Matthias Hoelzer-Kluepfel [email protected][email protected]de.o[email protected]rg
Matthias Elter elter[email protected]@kde[email protected].org
Daniel Molkentin molke[email protected]ntin[email protected]@kde.[email protected]org

Definition at line 48 of file kcmoduleinfo.h.

Constructor & Destructor Documentation

KCModuleInfo::KCModuleInfo ( const QString desktopFile)

Constructs a KCModuleInfo.

Note
a KCModuleInfo object will have to be manually deleted, it is not done automatically for you.
Parameters
desktopFilethe desktop file representing the module, or the name of the module.

Definition at line 103 of file kcmoduleinfo.cpp.

KCModuleInfo::KCModuleInfo ( const KPluginInfo pluginInfo)

Same as above but takes a KPluginInfo as argument.

This allows to encapsulate both the case of KService (desktop file) and the case of KPluginMetaData (JSon data in .so file) under the same API.

Parameters
pluginInfospecifies the module
Since
5.70

Definition at line 113 of file kcmoduleinfo.cpp.

KCModuleInfo::KCModuleInfo ( KService::Ptr  moduleInfo)

Same as above but takes a KService::Ptr as argument.

Note
moduleInfo must be a valid pointer.
Parameters
moduleInfospecifies the module

Definition at line 108 of file kcmoduleinfo.cpp.

KCModuleInfo::KCModuleInfo ( const KCModuleInfo rhs)

Copy constructor.

Parameters
rhsspecifies the module info to copy

Definition at line 118 of file kcmoduleinfo.cpp.

KCModuleInfo::KCModuleInfo ( )

Same as above but creates an empty KCModuleInfo.

You should not normally call this.

Definition at line 98 of file kcmoduleinfo.cpp.

KCModuleInfo::~KCModuleInfo ( )

Default destructor.

Definition at line 140 of file kcmoduleinfo.cpp.

Member Function Documentation

QString KCModuleInfo::comment ( ) const
Returns
the module's (translated) comment field

Definition at line 220 of file kcmoduleinfo.cpp.

QString KCModuleInfo::docPath ( ) const
Returns
the path of the module's documentation

Definition at line 235 of file kcmoduleinfo.cpp.

QString KCModuleInfo::fileName ( ) const
Returns
the filename of the .desktop file that describes the KCM

Definition at line 189 of file kcmoduleinfo.cpp.

QString KCModuleInfo::handle ( ) const
Returns
a handle (the contents of the X-KDE-FactoryName field if it exists, else the same as the library name)

Definition at line 244 of file kcmoduleinfo.cpp.

QString KCModuleInfo::icon ( ) const
Returns
the module's icon name

Definition at line 225 of file kcmoduleinfo.cpp.

bool KCModuleInfo::isValid ( ) const

Returns true if the KCM was found.

Since
5.71

Definition at line 145 of file kcmoduleinfo.cpp.

QStringList KCModuleInfo::keywords ( ) const
Returns
the keywords associated with this KCM.

Definition at line 194 of file kcmoduleinfo.cpp.

QString KCModuleInfo::library ( ) const
Returns
the library name

Definition at line 230 of file kcmoduleinfo.cpp.

QString KCModuleInfo::moduleName ( ) const
Returns
the module\'s (translated) name

Definition at line 199 of file kcmoduleinfo.cpp.

bool KCModuleInfo::operator!= ( const KCModuleInfo rhs) const
Returns
true if rhs is not equal itself

Definition at line 135 of file kcmoduleinfo.cpp.

KCModuleInfo & KCModuleInfo::operator= ( const KCModuleInfo rhs)

Assignment operator.

Definition at line 124 of file kcmoduleinfo.cpp.

bool KCModuleInfo::operator== ( const KCModuleInfo rhs) const

Returns true if rhs describes the same KCModule as this object.

Definition at line 130 of file kcmoduleinfo.cpp.

KPluginInfo KCModuleInfo::pluginInfo ( ) const
Returns
the KPluginInfo containing more information about this module
Since
5.70

Definition at line 215 of file kcmoduleinfo.cpp.

QVariant KCModuleInfo::property ( const QString key) const
Returns
The value associated to the key. You can use it if you want to read custom values. To do this you need to define your own servicetype and add it to the ServiceTypes keys.
Since
5.71

Definition at line 262 of file kcmoduleinfo.cpp.

KService::Ptr KCModuleInfo::service ( ) const
Returns
a QExplicitlySharedDataPointer to KService created from the modules .desktop file
Warning
This will be null if this KCModuleInfo was created from a KPluginInfo coming from KPluginMetaData. Prefer using pluginInfo() instead, which works for both kinds.

Definition at line 204 of file kcmoduleinfo.cpp.

int KCModuleInfo::weight ( ) const
Returns
the weight of the module which determines the order of the pages in the KCMultiDialog. It's set by the X-KDE-Weight field.

Definition at line 253 of file kcmoduleinfo.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue May 26 2020 23:00:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.