aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/DbSqliteCipher/dbsqlitecipher.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2017-02-09 04:36:04 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2017-02-09 04:36:04 -0500
commitd9aa870e5d509cc7309ab82dd102a937ab58613a (patch)
treed92d03d76b5c390b335f1cfd761f1a0b59ec8496 /Plugins/DbSqliteCipher/dbsqlitecipher.cpp
parent68ee4cbcbe424b95969c70346283a9f217f63825 (diff)
Imported Upstream version 3.1.1+dfsg1upstream/3.1.1+dfsg1
Diffstat (limited to 'Plugins/DbSqliteCipher/dbsqlitecipher.cpp')
-rw-r--r--Plugins/DbSqliteCipher/dbsqlitecipher.cpp37
1 files changed, 5 insertions, 32 deletions
diff --git a/Plugins/DbSqliteCipher/dbsqlitecipher.cpp b/Plugins/DbSqliteCipher/dbsqlitecipher.cpp
index 13fa346..fd6c909 100644
--- a/Plugins/DbSqliteCipher/dbsqlitecipher.cpp
+++ b/Plugins/DbSqliteCipher/dbsqlitecipher.cpp
@@ -20,32 +20,6 @@ bool DbSqliteCipher::checkIfDbServedByPlugin(Db* db) const
return (db && dynamic_cast<DbSqliteCipherInstance*>(db));
}
-Db* DbSqliteCipher::getInstance(const QString& name, const QString& path, const QHash<QString, QVariant>& options, QString* errorMessage)
-{
- UNUSED(errorMessage);
-
- if (!initValid)
- return nullptr;
-
- Db* db = new DbSqliteCipherInstance(name, path, options);
-
- if (!db->openForProbing())
- {
- delete db;
- return nullptr;
- }
-
- SqlQueryPtr results = db->exec("SELECT * FROM sqlite_master");
- if (results->isError())
- {
- delete db;
- return nullptr;
- }
-
- db->closeQuiet();
- return db;
-}
-
QList<DbPluginOption> DbSqliteCipher::getOptionsList() const
{
static const QStringList ciphers = {"aes-128-cbc", "aes-128-cfb", "aes-128-cfb1", "aes-128-cfb8", "aes-128-ctr", "aes-128-ecb", "aes-128-gcm", "aes-128-ofb",
@@ -108,12 +82,6 @@ QList<DbPluginOption> DbSqliteCipher::getOptionsList() const
return opts;
}
-QString DbSqliteCipher::generateDbName(const QVariant& baseValue)
-{
- QFileInfo file(baseValue.toString());
- return file.baseName();
-}
-
bool DbSqliteCipher::init()
{
Q_INIT_RESOURCE(dbsqlitecipher);
@@ -139,3 +107,8 @@ void DbSqliteCipher::deinit()
SQLITESTUDIO->getExtraLicenseManager()->removeLicense(LICENSE_TITLE);
Q_CLEANUP_RESOURCE(dbsqlitecipher);
}
+
+Db *DbSqliteCipher::newInstance(const QString &name, const QString &path, const QHash<QString, QVariant> &options)
+{
+ return new DbSqliteCipherInstance(name, path, options);
+}