You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
692 B
C

#ifndef CONTEXT_H
#define CONTEXT_H
#include <QList>
#include <QMap>
#include <QString>
#include <QSqlDatabase>
#include "core_global.h"
#include "transaction.h"
#include <odb/database.hxx>
class IPlugin;
class CORESHARED_EXPORT Context
{
public:
static Context &instance();
QList<IPlugin*> plugins();
IPlugin *plugin(const QString &pluginId);
void loadPlugins();
void openDb(const QString &path);
odb::database *db() { return m_db; }
private:
Context();
QList<IPlugin*> m_plugins;
odb::database *m_db;
void checkDb(const QString &path);
void checkSchema(const QSqlDatabase &db, const QMap<QString, int> &schemaMap);
};
#endif // CONTEXT_H