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

@@ -1,6 +1,8 @@
#ifndef SQLITEDB_H
#define SQLITEDB_H
#include "database.h"
#include <vitamtp.h>
#include <QObject>
@@ -25,7 +27,7 @@
#define OBJECT_APPLICATION 0x00080000
class SQLiteDB : public QObject
class SQLiteDB : public Database
{
Q_OBJECT
public:
@@ -51,6 +53,8 @@ public:
uint insertSavedataEntry(const QString &path, int type, int parent);
uint insertApplicationEntry(const QString &path, int type, int parent, int app_type);
bool getObjectMetadata(int ohfi, metadata_t &metadata);
private:
int recursiveScanRootDirectory(const QString &base_path, int parent, int type);
uint insertDirectoryEntry(const QString &path, int type, int parent);