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

#include <PythonPluginManager.h>

Public Member Functions

QString comment () const
 
const QString & errorReason () const
 
bool isBroken () const
 
bool isEnabled () const
 
bool isUnstable () const
 
bool isValid () const
 
QString manual () const
 
QString moduleFilePathPart () const
 
QString moduleName () const
 
QString name () const
 
QVariant property (const QString &name) const
 

Private Member Functions

 PythonPlugin ()
 

Private Attributes

bool m_broken {false}
 
QString m_comment
 
bool m_enabled {false}
 
QString m_errorReason
 
bool m_loaded {false}
 
QString m_manual
 
QString m_moduleName
 
QString m_name
 
QMap< QString, QVariant > m_properties
 
bool m_unstable {false}
 

Friends

class PythonPluginManager
 

Detailed Description

Represents a Python described in the plugin's .desktop file.

Definition at line 22 of file PythonPluginManager.h.

Constructor & Destructor Documentation

◆ PythonPlugin()

PythonPlugin::PythonPlugin ( )
inlineprivate

Definition at line 80 of file PythonPluginManager.h.

80 {
81 m_properties["X-Python-Dependencies"] = QStringList();
82 }
QList< QString > QStringList
QMap< QString, QVariant > m_properties

References m_properties.

Member Function Documentation

◆ comment()

QString PythonPlugin::comment ( ) const
inline

Definition at line 67 of file PythonPluginManager.h.

68 {
69 return m_comment;
70 }

References m_comment.

◆ errorReason()

const QString & PythonPlugin::errorReason ( ) const
inline

Definition at line 32 of file PythonPluginManager.h.

33 {
34 return m_errorReason;
35 }

References m_errorReason.

◆ isBroken()

bool PythonPlugin::isBroken ( ) const
inline

Definition at line 42 of file PythonPluginManager.h.

43 {
44 return m_broken;
45 }

References m_broken.

◆ isEnabled()

bool PythonPlugin::isEnabled ( ) const
inline

Definition at line 37 of file PythonPluginManager.h.

38 {
39 return m_enabled;
40 }

References m_enabled.

◆ isUnstable()

bool PythonPlugin::isUnstable ( ) const
inline

Definition at line 47 of file PythonPluginManager.h.

48 {
49 return m_unstable;
50 }

References m_unstable.

◆ isValid()

bool PythonPlugin::isValid ( ) const

Definition at line 47 of file PythonPluginManager.cpp.

48{
49 dbgScript << "Got Krita/PythonPlugin: " << name()
50 << ", module-path=" << moduleName()
51 ;
52 // Make sure mandatory properties are here
53 if (m_name.isEmpty()) {
54 dbgScript << "Ignore desktop file w/o a name";
55 return false;
56 }
57 if (m_moduleName.isEmpty()) {
58 dbgScript << "Ignore desktop file w/o a module to import";
59 return false;
60 }
61
62 return true;
63}
QString name() const
QString moduleName() const
#define dbgScript
Definition kis_debug.h:56

References dbgScript, m_moduleName, m_name, moduleName(), and name().

◆ manual()

QString PythonPlugin::manual ( ) const
inline

Definition at line 72 of file PythonPluginManager.h.

73 {
74 return m_manual;
75 }

References m_manual.

◆ moduleFilePathPart()

QString PythonPlugin::moduleFilePathPart ( ) const

Transforms the Python module name into a file path part

Definition at line 41 of file PythonPluginManager.cpp.

42{
43 QString filePath = m_moduleName;
44 return filePath.replace(".", "/");
45}

References m_moduleName.

◆ moduleName()

QString PythonPlugin::moduleName ( ) const
inline

Definition at line 57 of file PythonPluginManager.h.

58 {
59 return m_moduleName;
60 }

References m_moduleName.

◆ name()

QString PythonPlugin::name ( ) const
inline

Definition at line 52 of file PythonPluginManager.h.

53 {
54 return m_name;
55 }

References m_name.

◆ property()

QVariant PythonPlugin::property ( const QString & name) const
inline

Definition at line 62 of file PythonPluginManager.h.

63 {
64 return m_properties.value(name, "");
65 }

References m_properties, and name().

Friends And Related Symbol Documentation

◆ PythonPluginManager

friend class PythonPluginManager
friend

Definition at line 78 of file PythonPluginManager.h.

Member Data Documentation

◆ m_broken

bool PythonPlugin::m_broken {false}
private

Definition at line 86 of file PythonPluginManager.h.

86{false};

◆ m_comment

QString PythonPlugin::m_comment
private

Definition at line 92 of file PythonPluginManager.h.

◆ m_enabled

bool PythonPlugin::m_enabled {false}
private

Definition at line 85 of file PythonPluginManager.h.

85{false};

◆ m_errorReason

QString PythonPlugin::m_errorReason
private

Definition at line 84 of file PythonPluginManager.h.

◆ m_loaded

bool PythonPlugin::m_loaded {false}
private

Definition at line 88 of file PythonPluginManager.h.

88{false};

◆ m_manual

QString PythonPlugin::m_manual
private

Definition at line 93 of file PythonPluginManager.h.

◆ m_moduleName

QString PythonPlugin::m_moduleName
private

Definition at line 91 of file PythonPluginManager.h.

◆ m_name

QString PythonPlugin::m_name
private

Definition at line 90 of file PythonPluginManager.h.

◆ m_properties

QMap<QString, QVariant> PythonPlugin::m_properties
private

Definition at line 95 of file PythonPluginManager.h.

◆ m_unstable

bool PythonPlugin::m_unstable {false}
private

Definition at line 87 of file PythonPluginManager.h.

87{false};

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