Logo Search packages:      
Sourcecode: akonadi version File versions  Download package

Akonadi::DataStore Class Reference

#include <datastore.h>

Inherited by Akonadi::MockBackend.

List of all members.


Detailed Description

This class handles all the database access.

Database configuration

You can select between various database backends during runtime using the $HOME/.config/akonadi/akonadiserverrc configuration file.

Example:

[%General]
Driver=QMYSQL

[QMYSQL_EMBEDDED]
Name=akonadi
Options=SERVER_DATADIR=/home/foo/.local/share/akonadi/db_data

[QMYSQL]
Name=akonadi
Host=localhost
User=foo
Password=*****
#Options=UNIX_SOCKET=/home/foo/.local/share/akonadi/db_misc/mysql.socket

[QSQLITE]
Name=/home/foo/.local/share/akonadi/akonadi.db

Use General/Driver to select the QSql driver to use for databse access. The following drivers are currently supported, other might work but are untested:

The options for each driver are read from the corresponding group. The following options are supported, dependent on the driver not all of them might have an effect:

Definition at line 95 of file datastore.h.


Signals

void transactionCommitted ()
void transactionRolledBack ()

Public Member Functions

void activeCachePolicy (Location &loc)
bool addCollectionAttribute (const Location &loc, const QByteArray &key, const QByteArray &value)
bool appendFlag (const QString &name)
bool appendItemFlags (const PimItem &item, const QList< QByteArray > &flags, bool checkIfExists=true, const Location &loc=Location())
bool appendItemFlags (const PimItem &item, const QList< Flag > &flags, bool checkIfExists=true, const Location &loc=Location())
bool appendLocation (Location &location)
bool appendMimeType (const QString &mimetype, qint64 *insertId=0)
bool appendMimeTypeForLocation (qint64 locationId, const QStringList &mimeTypes)
bool appendPimItem (const QList< Part > &parts, const MimeType &mimetype, const Location &location, const QDateTime &dateTime, const QByteArray &remote_id, PimItem &pimItem)
bool beginTransaction ()
bool cleanupLocation (Location &location)
 removes the given location and all its content
bool cleanupPimItem (const PimItem &item)
bool cleanupPimItems (const Location &location)
void close ()
bool commitTransaction ()
QSqlDatabase database () const
qint64 highestPimItemId () const
bool init ()
bool inTransaction () const
QList< PimItem > listPimItems (const Location &location, const Flag &flag)
NotificationCollectornotificationCollector () const
void open ()
bool removeCollectionAttribute (const Location &loc, const QByteArray &key)
bool removeItemFlags (const PimItem &item, const QList< Flag > &flags)
bool removeItemParts (const PimItem &item, const QList< QByteArray > &parts)
bool removeMimeTypesForLocation (qint64 locationId)
bool renameLocation (Location &location, qint64 newParent, const QByteArray &newName)
 rename the collection location to newName.
void retrieveDataFromResource (qint64 uid, const QByteArray &remote_id, const QByteArray &mimeType, const QString &resource, const QStringList &parts)
bool rollbackTransaction ()
bool setItemFlags (const PimItem &item, const QList< Flag > &flags)
void setSessionId (const QByteArray &sessionId)
QString storagePath () const
void triggerCollectionSync (const Location &location)
qint64 uidNext () const
bool updatePimItem (PimItem &pimItem, const QString &remoteId)
bool updatePimItem (PimItem &pimItem, const Location &destination)
bool updatePimItem (PimItem &pimItem)
virtual ~DataStore ()

Static Public Member Functions

static QString driverName ()
static qint64 lastInsertId (const QSqlQuery &query)
static QString locationDelimiter ()
static DataStoreself ()

Protected Member Functions

 DataStore ()
void debugLastDbError (const char *actionDescription) const
void debugLastQueryError (const QSqlQuery &query, const char *actionDescription) const

Private Member Functions

org::freedesktop::Akonadi::Resource * resourceInterface (const QString &res)

Static Private Member Functions

static QString dateTimeFromQDateTime (const QDateTime &dateTime)
static QDateTime dateTimeToQDateTime (const QByteArray &dateTime)

Private Attributes

QString m_connectionName
QSqlDatabase m_database
bool m_dbOpened
uint m_transactionLevel
NotificationCollectormNotificationCollector
QHash< QString,
org::freedesktop::Akonadi::Resource * > 
mResourceInterfaceCache
QByteArray mSessionId

Static Private Attributes

static QString mDbConnectionOptions
static QString mDbDriverName
static QString mDbHostName
static QString mDbName
static QString mDbPassword
static QString mDbUserName
static QList< int > mPendingItemDeliveries
static QWaitCondition mPendingItemDeliveriesCondition
static QMutex mPendingItemDeliveriesMutex

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

Generated by  Doxygen 1.6.0   Back to index