aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/DbSqliteSystemData/dbsqlitesystemdata.cpp
blob: b5098d5cd67ea0aef66fd4df9cc72cf27aad7ad8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "dbsqlitesystemdata.h"
#include "dbsqlitesystemdatainstance.h"

DbSqliteSystemData::DbSqliteSystemData()
{
}

QString DbSqliteSystemData::getLabel() const
{
    return "System.Data.SQLite";
}

QList<DbPluginOption> DbSqliteSystemData::getOptionsList() const
{
    QList<DbPluginOption> opts;

    DbPluginOption opt;
    opt.type = DbPluginOption::PASSWORD;
    opt.key = PASSWORD_OPT;
    opt.label = tr("Password (key)");
    opt.toolTip = tr("Leave empty to create or connect to decrypted database.");
    opt.placeholderText = tr("Encryption password");
    opts << opt;

    return opts;
}

bool DbSqliteSystemData::checkIfDbServedByPlugin(Db *db) const
{
    return (db && dynamic_cast<DbSqliteSystemDataInstance*>(db));
}

Db *DbSqliteSystemData::newInstance(const QString &name, const QString &path, const QHash<QString, QVariant> &options)
{
    return new DbSqliteSystemDataInstance(name, path, options);
}