Classified ads
|
Datamodel-part of storage related to TCL-programs. More...
#include <tclmodel.h>
Signals | |
void | error (MController::CAErrorSituation aError, const QString &aExplanation) |
Public Member Functions | |
TclModel (MController *aMController, const MModelProtocolInterface &aModel) | |
~TclModel () | |
Hash | locallyStoreTclProgram (const TclProgram &aProgram, const Hash &aPreviousFingerPrint=KNullHash) |
TclProgram | tclProgramByFingerPrint (const Hash &aFingerPrint) |
bool | discardTclProgram (const Hash &aFingerPrint) |
QMap< QString, Hash > | getListOfTclPrograms () |
QString | storeTCLProgLocalData (const Hash &aProgram, const QByteArray &aData) |
QByteArray | retrieveTCLProgLocalData (const Hash &aProgram) |
Private Member Functions | |
void | installExamplePrograms () |
Private Attributes | |
MController & | iController |
const MModelProtocolInterface & | iModel |
Datamodel-part of storage related to TCL-programs.
This class provides with storage of TCL-scripts themselves, possible settings related to TCL-scripts. See class TclProgram.
TclModel::TclModel | ( | MController * | aMController, |
const MModelProtocolInterface & | aModel | ||
) |
TclModel::~TclModel | ( | ) |
bool TclModel::discardTclProgram | ( | const Hash & | aFingerPrint | ) |
method for removing tcl script from local storage
|
signal |
QMap<QString, Hash> TclModel::getListOfTclPrograms | ( | ) |
method for getting list of tcl programs in local storage
|
private |
Method that scans directory /usr/share/doc/classified-ads/examples for files ending *.tcl and installs them into database table of tcl programs. This is done only if db table is empty, as it is during first install.
Hash TclModel::locallyStoreTclProgram | ( | const TclProgram & | aProgram, |
const Hash & | aPreviousFingerPrint = KNullHash |
||
) |
Method for putting tcl program into local storage. Method performs insert or update. Logick is this: if there is program in db with aPreviousFingerPrint then update is performed. In this case previous fingerprint won't be valid any more. Otherwise insert is done and method returns fingerprint of the program stored.
aProgram | is the program to store. |
aPreviousFingerPrint | if persisting program from UI, fingerprint of the program |
QByteArray TclModel::retrieveTCLProgLocalData | ( | const Hash & | aProgram | ) |
Method for retrieving local data of a tcl program
aProgram | identifies the program |
QString TclModel::storeTCLProgLocalData | ( | const Hash & | aProgram, |
const QByteArray & | aData | ||
) |
TCL programs may store data locally, key to the data is hash of the tcl program itself and the data is a byte-array. Previous contents are overwritten.
aProgram | identifies the program |
aData | is databytes |
TclProgram TclModel::tclProgramByFingerPrint | ( | const Hash & | aFingerPrint | ) |
method for getting tcl progrom from local storage
|
private |
|
private |