#include <qtrackedvariant.h>
Signals | |
void | changed () |
Public Member Functions | |
QTrackedVariant (const QString &key) | |
~QTrackedVariant () | |
void | set (const QVariant &newValue) |
QVariant | value () |
QString | key () const |
const char * | keyChar () const |
Protected Member Functions | |
virtual void | emit_changed () |
virtual void | realSetValue (const QVariant &newValue) |
virtual void | fetchFromBackend () |
Protected Attributes | |
QVariant | m_val |
A simple class that is used as a variable that have a constant name (it is called the 'key' here) and a value with an arbitrary type. The class has a signal to be emitted when the value is changed.
The storage of the tracked varian might be the profile database (provided by the profile daemon) or the GConf database depending on the actual implementation of the class, e.g. the AlertTone class uses the profile database to store/retrieve data.
FIXME: This class should be pure virtual but the ut_trackedvariant unit test should be modified to handle that.
QTrackedVariant::QTrackedVariant | ( | const QString & | key | ) |
The constructor of the class sets the key that will not be modified during the lifetime of the object.
QTrackedVariant::~QTrackedVariant | ( | ) |
QTrackedVariant destructor
void QTrackedVariant::changed | ( | ) | [signal] |
This signal is emitted when the value for the variant is modified, by the application or by an outside process.
void QTrackedVariant::emit_changed | ( | ) | [protected, virtual] |
Emits the changed() signal.
void QTrackedVariant::fetchFromBackend | ( | ) | [protected, virtual] |
Virtual method to retrieve the data from the database backend. FIXME: This method should be pure virtual.
Reimplemented in AlertTone, and QProfileValue.
QString QTrackedVariant::key | ( | ) | const |
const char * QTrackedVariant::keyChar | ( | ) | const |
Convenience function to retrieve the value of the variant as a null terminated string.
void QTrackedVariant::realSetValue | ( | const QVariant & | newValue | ) | [protected, virtual] |
Virtual method to save the data to the database backend. FIXME: This method should be pure virtual.
Reimplemented in AlertTone, and QProfileValue.
void QTrackedVariant::set | ( | const QVariant & | newValue | ) |
Sets the value of the variant, calls the appropriate virtual function to store the value in the profile database or in the GConf database.
QVariant QTrackedVariant::value | ( | ) |
QVariant QTrackedVariant::m_val [protected] |
The tracked variant object