KDE 4.9 PyKDE API Reference

- KDE's Python API

# Session Class Reference

`from PyKDE4.akonadi import *`

Inherits: QObject
Namespace: Akonadi

## Detailed Description

A communication session with the Akonadi storage.

Every Job object has to be associated with a Session. The session is responsible of scheduling its jobs. For now only a simple serial execution is implemented (the IMAP-like protocol to communicate with the storage backend is capable of parallel execution on a single session though).

     using namespace Akonadi;

     Session *session = new Session( "mySession" );

     CollectionFetchJob *job = new CollectionFetchJob( Collection.root(),
                                                       CollectionFetchJob.Recursive,
                                                       session );

     connect( job, SIGNAL( result( KJob* ) ), this, SLOT( slotResult( KJob* ) ) );

Author:
  Volker Krause <vkrause@kde.org>

## Signals

| reconnected ()

## Methods

| __init__ (self, QByteArray sessionId=QByteArray(), QObject parent=0)
| clear (self)
QByteArray | sessionId (self)

## Static Methods

Akonadi.Session | defaultSession ()

## Signal Documentation

reconnected | ( |  | ) |

This signal is emitted whenever the session has been reconnected to the server (e.g. after a server crash).

Since:
  4.6

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

## Method Documentation

__init__ | ( | self, |
|  | QByteArray | sessionId=QByteArray(),
|  | QObject | parent=0
| ) |  |  |

Creates a new session.

Parameters:

  | sessionId | The identifier for this session, will be a random value if empty.
  | parent | The parent object.

See also:
  defaultSession()

clear | ( |  | self ) |

Stops all jobs queued for execution.

QByteArray sessionId | ( |  | self ) |

Returns the session identifier.

## Static Method Documentation

Akonadi.Session defaultSession | ( |  | ) |

Returns the default session for this thread.