Create a unified base class to access the database.

Moved the default database class to QListDB and disallow leaking CMAObjects outside this class.
Rewrote QListDB and CMAEvent to use the new internal API.
Moved the file format constants to the base database class.
Moved the metadata loading methods to the base database class.
This commit is contained in:
codestation
2014-01-28 14:00:15 -04:30
parent e1aa32894d
commit b7ad2b13f4
15 changed files with 514 additions and 380 deletions

View File

@@ -115,7 +115,7 @@ static const char *trigger_list[] = {
};
SQLiteDB::SQLiteDB(QObject *parent) :
QObject(parent)
Database(parent)
{
uuid = QSettings().value("lastAccountId", "ffffffffffffffff").toString();
}
@@ -275,6 +275,13 @@ int SQLiteDB::recursiveScanRootDirectory(const QString &base_path, int parent, i
return total_objects;
}
bool SQLiteDB::getObjectMetadata(int ohfi, metadata_t &metadata)
{
Q_UNUSED(ohfi);
Q_UNUSED(metadata);
return false;
}
int SQLiteDB::getPathId(const QString &path)
{
QSqlQuery query(QString("SELECT object_id from sources WHERE path = %1").arg(path));