#include <infocdbbackend.h>
Public Member Functions | |
InfoCdbBackend (QObject *parent=0) | |
~InfoCdbBackend () | |
virtual QString | name () const |
Returns 'cdb'. | |
virtual QStringList | listKeys () const |
Returns the list of all the keys in the registry. | |
virtual QString | docForKey (QString key) const |
Returns the documentation for the given key name. | |
virtual bool | keyDeclared (QString key) const |
Returns true if the given key exists. | |
virtual bool | keyDeprecated (QString key) const |
Returns true if the given key is deprecated. | |
virtual const QList < ContextProviderInfo > | providersForKey (QString key) const |
Returns a list of providers for the given key. | |
virtual ContextTypeInfo | typeInfoForKey (QString key) const |
Returns the type information for the given key. | |
Static Public Member Functions | |
static QString | databaseDirectory () |
Returns the full path to the database directory. | |
static QString | databasePath () |
Returns the full path to the database. | |
static bool | databaseExists () |
Returns true if the database file is present. | |
Private Slots | |
void | onDatabaseDirectoryChanged (const QString &path) |
Called when the database directory changes. | |
Private Member Functions | |
void | watch () |
void | checkCompatibility () |
Update the database compatibility field. | |
Static Private Member Functions | |
static QStringList | variantListToStringList (const QVariantList &l) |
Private Attributes | |
QFileSystemWatcher * | watcher |
A watched object obsering the database file. Delivers synced notifications. | |
CDBReader | reader |
The cdb reader object used to access the cdb database. | |
bool | databaseCompatible |
If the currently open database is compatible (versions match). | |
quint64 | lastInode |
This class is not exported in the public API. It does not cache any data to optimize the memory consumption. It's assumed that most data is anyways cached (as needed) in the ContextPropertyInfo and the cdb key-based access (no enumetation) is fast anyways. It observers the cache.cdb
with a file system watcher.
InfoCdbBackend::InfoCdbBackend | ( | QObject * | parent = 0 |
) | [explicit] |
InfoCdbBackend::~InfoCdbBackend | ( | ) |
QString InfoCdbBackend::name | ( | ) | const [virtual] |
QStringList InfoCdbBackend::listKeys | ( | ) | const [virtual] |
QString InfoCdbBackend::docForKey | ( | QString | key | ) | const [virtual] |
bool InfoCdbBackend::keyDeclared | ( | QString | key | ) | const [virtual] |
bool InfoCdbBackend::keyDeprecated | ( | QString | key | ) | const [virtual] |
const QList< ContextProviderInfo > InfoCdbBackend::providersForKey | ( | QString | key | ) | const [virtual] |
ContextTypeInfo InfoCdbBackend::typeInfoForKey | ( | QString | key | ) | const [virtual] |
QString InfoCdbBackend::databaseDirectory | ( | ) | [static] |
Returns the full path to the database directory.
Takes the CONTEXT_PROVIDERS
env variable into account.
QString InfoCdbBackend::databasePath | ( | ) | [static] |
Returns the full path to the database.
Takes the CONTEXT_PROVIDERS
env variable into account.
bool InfoCdbBackend::databaseExists | ( | ) | [static] |
Returns true if the database file is present.
void InfoCdbBackend::watch | ( | ) | [private] |
QStringList InfoCdbBackend::variantListToStringList | ( | const QVariantList & | l | ) | [static, private] |
void InfoCdbBackend::checkCompatibility | ( | ) | [private] |
Update the database compatibility field.
void InfoCdbBackend::onDatabaseDirectoryChanged | ( | const QString & | path | ) | [private, slot] |
Called when the database directory changes.
Reopens the database and emits the change signal if the inode of the database has been modified.
QFileSystemWatcher* InfoCdbBackend::watcher [private] |
A watched object obsering the database file. Delivers synced notifications.
CDBReader InfoCdbBackend::reader [private] |
The cdb reader object used to access the cdb database.
bool InfoCdbBackend::databaseCompatible [private] |
If the currently open database is compatible (versions match).
quint64 InfoCdbBackend::lastInode [private] |