# class KPluginInfo

###

Module | kdecore
Namespace |
Class | KPluginInfo
Inherits |

Information about a plugin.

This holds all the information about a plugin there is. It's used for the user to decide whether he wants to use this plugin or not.

Author Matthias Kretz <kretz@kde.org>

### methods

- KPluginInfo (filename, resource)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  filename | QString |
  resource | char | 0

  Read plugin info from filename.

  The file should be of the following form:

      [Desktop Entry]
      Encoding=UTF-8
      Icon=mypluginicon
      Type=Service
      ServiceTypes=KPluginInfo

      Name=User Visible Name
      Comment=Description of what the plugin does

      X-KDE-PluginInfo-Author=Author's Name
      X-KDE-PluginInfo-Email=author@foo.bar
      X-KDE-PluginInfo-Name=internalname
      X-KDE-PluginInfo-Version=1.1
      X-KDE-PluginInfo-Website=http://www.plugin.org/
      X-KDE-PluginInfo-Category=playlist
      X-KDE-PluginInfo-Depends=plugin1,plugin3
      X-KDE-PluginInfo-License=GPL
      X-KDE-PluginInfo-EnabledByDefault=true

  The Name and Comment fields must always be present.

  The "X-KDE-PluginInfo" keys you may add further entries which will be available using property(). The Website,Category,Require keys are optional. For EnabledByDefault look at isPluginEnabledByDefault.

  filename - The filename of the .desktop file.

  resource - If filename is relative, you need to specify a resource type (e.g. "service", "apps"... KStandardDirs). Otherwise, resource isn't used.

- KPluginInfo (service)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  service | KService.Ptr |

  Read plugin info from a KService object.

  The .desktop file should look like this:

      [Desktop Entry]
      Encoding=UTF-8
      Icon=mypluginicon
      Type=Service
      ServiceTypes=KPluginInfo

      X-KDE-PluginInfo-Author=Author's Name
      X-KDE-PluginInfo-Email=author@foo.bar
      X-KDE-PluginInfo-Name=internalname
      X-KDE-PluginInfo-Version=1.1
      X-KDE-PluginInfo-Website=http://www.plugin.org/
      X-KDE-PluginInfo-Category=playlist
      X-KDE-PluginInfo-Depends=plugin1,plugin3
      X-KDE-PluginInfo-License=GPL
      X-KDE-PluginInfo-EnabledByDefault=true

      Name=User Visible Name
      Comment=Description of what the plugin does

  In the first three entries the Icon entry is optional.

- KPluginInfo ( )

  returns ctor

  Creates an invalid plugin.

  See also isValid

- KPluginInfo (copy)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  copy | KPluginInfo |

  Creates a KPluginInfo object that shares the data with copy.

- KPluginInfo (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QString |
  a1 | char | 0

- KPluginInfo (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | KService.Ptr |

- author ( )

  returns QString

  Returns The author of this plugin.

- category ( )

  returns QString

  Returns The category of this plugin (e.g. playlist/skin).

- comment ( )

  returns QString

  Returns A comment describing the plugin.

- config ( )

  returns KConfigGroup

  Returns If the KPluginInfo object has a KConfig object set return it, else returns an invalid KConfigGroup.

- defaults ( )

  returns Nothing

  Restore defaults (enabled or not).

- dependencies ( )

  returns QStringList

  Returns A list of plugins required for this plugin to be enabled. Use the pluginName in this list.

- email ( )

  returns QString

  Returns The email address of the author.

- entryPath ( )

  returns QString

  Returns The file containing the information about the plugin.

- fromFiles (files, config)

  returns KPluginInfo.List
  static

  Argument | Type | Default
  --- | --- | ---
  files | QStringList |
  config | KConfigGroup | KConfigGroup()

  Returns A list of KPluginInfo objects constructed from a list of filenames. If you make a lookup using, for example, KStandardDirs.findAllResources() you pass the list of files to this function.

  files - The list of files to construct the list of KPluginInfo objects from

  config - The config group where to save/load whether the plugin is enabled/disabled

- fromKPartsInstanceName (componentName, config)

  returns KPluginInfo.List
  static

  Argument | Type | Default
  --- | --- | ---
  componentName | QString |
  config | KConfigGroup | KConfigGroup()

  Returns A list of KPluginInfo objects for the KParts plugins of a component. You only need the name of the component not a pointer to the KComponentData object.

  componentName - Use the component name to look up all KParts plugins for it.

  config - The config group where to save/load whether the plugin is enabled/disabled

- fromServices (services, config)

  returns KPluginInfo.List
  static

  Argument | Type | Default
  --- | --- | ---
  services | KService.List |
  config | KConfigGroup | KConfigGroup()

  Returns A list of KPluginInfo objects constructed from a list of KService objects. If you get a trader offer of the plugins you want to use you can just pass them to this function.

  services - The list of services to construct the list of KPluginInfo objects from

  config - The config group where to save/load whether the plugin is enabled/disabled

- fullLicense ( )

  returns KAboutLicense
  KDE 4.1.0 and later only

  Returns The full license object, according to the license keyword. It can be used to present friendlier and more detailed license info to the user, when the license is one of the widespread within KDE. For other licenses, the license object will state not very useful, "custom license" info (this can be identified by KAboutLicense.key() returning KAboutData.License_Custom).

  See also KAboutLicense.byKeyword() @since 4.1

- icon ( )

  returns QString

  Returns The iconname for this plugin

- isHidden ( )

  returns bool

  Returns Whether the plugin should be hidden.

- isPluginEnabled ( )

  returns bool

  Returns Whether the plugin is currently loaded.

  See also setPluginEnabled()

  See also load()

- isPluginEnabledByDefault ( )

  returns bool

  Returns The default value whether the plugin is enabled or not. Defaults to the value set in the desktop file, or if that isn't set to false.

- isValid ( )

  returns bool

  Returns whether the object is valid. Treat invalid KPluginInfo objects like you would treat a null pointer.

- kcmServices ( )

  returns QList<KService::Ptr>

  Returns A list of Service pointers if the plugin installs one or more KCModule

- license ( )

  returns QString

  Returns The license keyword of this plugin.

- load (config)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  config | KConfigGroup | KConfigGroup()

  Load the state of the plugin - enabled or not.

  config - The KConfigGroup holding the information whether plugin is enabled.

- name ( )

  returns QString

  Returns The user visible name of the plugin.

- operator != (rhs)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  rhs | KPluginInfo |

  Compares two objects whether they don't share the same data.

- operator < (rhs)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  rhs | KPluginInfo |

  Less than relation comparing the categories and if they are the same using the names.

- operator == (rhs)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  rhs | KPluginInfo |

  Compares two objects whether they share the same data.

- operator > (rhs)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  rhs | KPluginInfo |

  Greater than relation comparing the categories and if they are the same using the names.

- pluginName ( )

  returns QString

  Returns The internal name of the plugin (for KParts Plugins this is the same name as set in the .rc file).

- property (key)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Returns The value associated the 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.

- save (config)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  config | KConfigGroup | KConfigGroup()

  Save state of the plugin - enabled or not.

  config - The KConfigGroup holding the information whether plugin is enabled.

- service ( )

  returns KService.Ptr

  Returns The KService object for this plugin. You might need 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. Then you can use the KService.property() method to read your keys.

  See also property()

- setConfig (config)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  config | KConfigGroup |

  Set the KConfigGroup to use for load()ing and save()ing the configuration. This will be overridden by the KConfigGroup passed to save() or load() (if one is passed).

- setPluginEnabled (enabled)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enabled | bool |

  Set whether the plugin is currently loaded.

  See also isPluginEnabled()

  See also save()

- version ( )

  returns QString

  Returns The version of the plugin.

- website ( )

  returns QString

  Returns The website of the plugin/author.