PolkitQt.Context

KDE 4.9 PyKDE API Reference

- KDE's Python API

# Context Class Reference

`from PyKDE4.polkitqt import *`

Inherits: QObject
Namespace: PolkitQt

## Detailed Description

Abstract class:
  This class can be used as a base class for new classes, but can not be instantiated directly.

\class Context context.h Context

Author:
  Daniel Nicoletti <dantti85-pk@yahoo.com.br>

Author:
  Dario Freddi <drf54321@gmail.com>

Convenience class for Qt/KDE applications

This class is a singleton that provides makes easy the usage of PolKitContext and PolKitTracker. It emits configChanged() whenever PolicyKit files change (e.g. the PolicyKit.conf or .policy files) or when ConsoleKit reports activities changes.

Note:
  This class is a singleton, its constructor is private. Call Context.instance() to get an instance of the Context object. Do not delete Context.instance(), cleanup will be done automatically.

## Signals
| configChanged ()
| consoleKitDBChanged ()
## Methods
bool | hasError (self)
QString | lastError (self)

## Signal Documentation

configChanged | ( |  | ) |

This signal will be emitted when a configuration file gets changed (e.g. /etc/PolicyKit/PolicyKit.conf or .policy files). Connect to this signal if you want to track down actions.

Note:
  If you use Action you'll probably prefer to use the dataChanged() signal to track Actions changes.

Signal syntax:
  `QObject.connect(source, SIGNAL("configChanged()"), target_slot)`

consoleKitDBChanged | ( |  | ) |

This signal is emitted when ConsoleKit configuration changes. This might happen when a session becomes active or inactive.

If you want to track your actions directly you should connect to this signal, as this might change the return value PolicyKit will give you.

Note:
  If you use Action you'll probably prefer to use the dataChanged() signal to track Action changes.

Signal syntax:
  `QObject.connect(source, SIGNAL("consoleKitDBChanged()"), target_slot)`

## Method Documentation

bool hasError | ( |  | self ) |

You should always call this method first, since if an error is detected, the library will retry to initialize itself.

Returns:
  true if the library is ready, false if an error occurred

QString lastError | ( |  | self ) |

Returns:
  the last error message