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

@@ -20,7 +20,6 @@
#ifndef CMAEVENT_H
#define CMAEVENT_H
#include "cmaobject.h"
#include "qlistdb.h"
#include "httpdownloader.h"
@@ -42,7 +41,7 @@ public:
static QListDB *db;
private:
uint16_t processAllObjects(CMAObject *parent, uint32_t handle);
uint16_t processAllObjects(metadata_t &metadata, uint32_t handle);
void vitaEventSendObject(vita_event_t *event, int eventId);
void vitaEventSendObjectMetadata(vita_event_t *event, int eventId);
void vitaEventSendNumOfObject(vita_event_t *event, int eventId);
@@ -79,7 +78,6 @@ private:
QMutex active;
QSemaphore sema;
static metadata_t g_thumbmeta;
static QFile *m_file;
signals: