Logo Search packages:      
Sourcecode: kamefu version File versions

Kamefu::CollectionAccess Class Reference

#include <collectionaccess.h>

List of all members.

Detailed Description

Singleton class access to database.

This class handle all transactions between the application and the database. Do not create this class directly, use CollectionAccess::self() instead.

Michaƫl Larouche

Definition at line 41 of file collectionaccess.h.

Public Types

enum  TableMode { TablePermanent = 0, TableTemporary = 1 }

Public Slots

void beginRomTransaction ()
void endRomTransaction (bool commit=true)
< Kamefu::RomMetaInformation
getAllRomsList ()
 Get the ROMs from database in a list. (sync).
< Kamefu::RomMetaInformation
getRomList (const KURL::List &romUrlList)
 Get the metainformations for the given list of urls (sync).
bool init ()
void insertNewRom (const Kamefu::RomMetaInformation &newRom)
 Insert a new ROM into the database. You must call beginRomTransaction() before calling this one.
void modifyExistingRom (const Kamefu::RomMetaInformation &existingRom)
 Modify an existing ROM in the database. Do nothing if a transaction is in progress.
void modifyRoms (const Kamefu::RomMetaInformation &commonInformation, const KURL::List &romUrlList)
 Modify common information for multiple ROMs Update multiple ROMs at time using common information(ex: same Developer, same Genre, etc...) Do nothing if a transaction is in progress.
void removeRomFromDatabase (const QString &romUrl)
 Remove a single ROM from the database.
void retrieveAllRoms ()
 Retrieve all ROM from database (async).
void retrieveRoms (const QString &query)
 Retrieve ROM from database for a given query. (async).
QStringList retrieveTableEntries (const QString &table)
 Retrieve table entries.
QStringList retrieveTableEntriesFiltered (const QString &table, const QString &filterValue)
 Retrieve table entries with a filter.


void databaseError (const QString &message)
void gettingRomMetaInformation (const Kamefu::RomMetaInformation &rom)
void romListingFinished ()

Public Member Functions

QSqlQuery executeQuery (const QString &query, const QString &errorMessage=QString::null)
Kamefu::RomMetaInformation getRomMetadataFromRomName (const QString &romName) KDE_DEPRECATED
Kamefu::RomMetaInformation getRomMetadataFromRomUrl (const QString &romUrl)
QString getRomUrlFromRomName (const QString &romName)
QString getSystemNameFromRomUrl (const QString &romUrl)
bool isRomUrlInDatabase (const QString &romUrl)
 Check if the current ROM url is in database.
bool isTransactionInProgress () const
 If a transaction is in progress.
 ~CollectionAccess ()

Static Public Member Functions

static CollectionAccessself ()

Private Member Functions

void cleanTables (int tableMode=0)
 CollectionAccess (QObject *parent=0, const char *name=0)
bool createConnection ()
void createIndex (const QString &indexName, const QString &tableName, const QString &fieldname, int indexLength=0)
int createNewIndex (const QString &fieldName, const QString &tableName)
void createTables (int tableMode=0)
void dropTables (int tableMode=0)
int getForeignId (const QString &key, const QString &table, const QString &researchFieldName, const QString &researchValue)

Private Attributes

Private * d

Static Private Attributes

static CollectionAccesss_self = 0L


class  Private

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

Generated by  Doxygen 1.6.0   Back to index