From d9aa870e5d509cc7309ab82dd102a937ab58613a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Thu, 9 Feb 2017 04:36:04 -0500 Subject: Imported Upstream version 3.1.1+dfsg1 --- Plugins/DbSqliteCipher/DbSqliteCipher.pro | 8 +++--- Plugins/DbSqliteCipher/DbSqliteCipher_de.ts | 2 +- Plugins/DbSqliteCipher/DbSqliteCipher_es.ts | 2 +- Plugins/DbSqliteCipher/DbSqliteCipher_fr.ts | 2 +- Plugins/DbSqliteCipher/DbSqliteCipher_it.ts | 2 +- Plugins/DbSqliteCipher/DbSqliteCipher_pl.ts | 2 +- Plugins/DbSqliteCipher/DbSqliteCipher_pt_BR.ts | 2 +- Plugins/DbSqliteCipher/DbSqliteCipher_ru.ts | 2 +- Plugins/DbSqliteCipher/DbSqliteCipher_sk.ts | 2 +- Plugins/DbSqliteCipher/DbSqliteCipher_zh_CN.ts | 2 +- Plugins/DbSqliteCipher/dbsqlitecipher.cpp | 37 ++++---------------------- Plugins/DbSqliteCipher/dbsqlitecipher.h | 9 ++++--- Plugins/DbSqliteCipher/dbsqlitecipher.json | 4 +-- Plugins/DbSqliteCipher/dbsqlitecipher.qrc | 3 +++ 14 files changed, 29 insertions(+), 50 deletions(-) (limited to 'Plugins/DbSqliteCipher') diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher.pro b/Plugins/DbSqliteCipher/DbSqliteCipher.pro index 1d3a358..84ce065 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher.pro +++ b/Plugins/DbSqliteCipher/DbSqliteCipher.pro @@ -6,7 +6,7 @@ QT -= gui -include($$PWD/../../../sqlitestudio/SQLiteStudio3/plugins.pri) +include($$PWD/../../SQLiteStudio3/plugins.pri) TARGET = DbSqliteCipher TEMPLATE = lib @@ -56,14 +56,16 @@ QMAKE_CFLAGS_WARN_ON = -Wall -Wno-unused-parameter -Wno-sign-compare -Wno-unused DISTFILES += \ openssl_lic.txt -TRANSLATIONS += \ +TRANSLATIONS += DbSqliteCipher_de.ts \ + \ DbSqliteCipher_it.ts\ DbSqliteCipher_zh_CN.ts\ DbSqliteCipher_sk.ts\ - DbSqliteCipher_de.ts\ DbSqliteCipher_ru.ts\ DbSqliteCipher_pt_BR.ts\ DbSqliteCipher_fr.ts\ DbSqliteCipher_es.ts\ DbSqliteCipher_pl.ts + + diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher_de.ts b/Plugins/DbSqliteCipher/DbSqliteCipher_de.ts index ae1f413..5ad1aa6 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher_de.ts +++ b/Plugins/DbSqliteCipher/DbSqliteCipher_de.ts @@ -1,6 +1,6 @@ - + DbSqliteCipher diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher_es.ts b/Plugins/DbSqliteCipher/DbSqliteCipher_es.ts index a9a9a1e..93c4650 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher_es.ts +++ b/Plugins/DbSqliteCipher/DbSqliteCipher_es.ts @@ -1,6 +1,6 @@ - + DbSqliteCipher diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher_fr.ts b/Plugins/DbSqliteCipher/DbSqliteCipher_fr.ts index 7f3589b..2739070 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher_fr.ts +++ b/Plugins/DbSqliteCipher/DbSqliteCipher_fr.ts @@ -1,6 +1,6 @@ - + DbSqliteCipher diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher_it.ts b/Plugins/DbSqliteCipher/DbSqliteCipher_it.ts index 0dc373c..e9f5c57 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher_it.ts +++ b/Plugins/DbSqliteCipher/DbSqliteCipher_it.ts @@ -1,6 +1,6 @@ - + DbSqliteCipher diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher_pl.ts b/Plugins/DbSqliteCipher/DbSqliteCipher_pl.ts index 03545b6..545d2bd 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher_pl.ts +++ b/Plugins/DbSqliteCipher/DbSqliteCipher_pl.ts @@ -1,6 +1,6 @@ - + DbSqliteCipher diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher_pt_BR.ts b/Plugins/DbSqliteCipher/DbSqliteCipher_pt_BR.ts index db11c84..560e130 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher_pt_BR.ts +++ b/Plugins/DbSqliteCipher/DbSqliteCipher_pt_BR.ts @@ -1,6 +1,6 @@ - + DbSqliteCipher diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher_ru.ts b/Plugins/DbSqliteCipher/DbSqliteCipher_ru.ts index b4cd459..25300e3 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher_ru.ts +++ b/Plugins/DbSqliteCipher/DbSqliteCipher_ru.ts @@ -1,6 +1,6 @@ - + DbSqliteCipher diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher_sk.ts b/Plugins/DbSqliteCipher/DbSqliteCipher_sk.ts index 877e002..692e4a4 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher_sk.ts +++ b/Plugins/DbSqliteCipher/DbSqliteCipher_sk.ts @@ -1,6 +1,6 @@ - + DbSqliteCipher diff --git a/Plugins/DbSqliteCipher/DbSqliteCipher_zh_CN.ts b/Plugins/DbSqliteCipher/DbSqliteCipher_zh_CN.ts index 74e8336..bbc4eea 100644 --- a/Plugins/DbSqliteCipher/DbSqliteCipher_zh_CN.ts +++ b/Plugins/DbSqliteCipher/DbSqliteCipher_zh_CN.ts @@ -1,6 +1,6 @@ - + DbSqliteCipher 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(db)); } -Db* DbSqliteCipher::getInstance(const QString& name, const QString& path, const QHash& 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 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 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 &options) +{ + return new DbSqliteCipherInstance(name, path, options); +} diff --git a/Plugins/DbSqliteCipher/dbsqlitecipher.h b/Plugins/DbSqliteCipher/dbsqlitecipher.h index ef2ffea..903acce 100644 --- a/Plugins/DbSqliteCipher/dbsqlitecipher.h +++ b/Plugins/DbSqliteCipher/dbsqlitecipher.h @@ -2,10 +2,10 @@ #define DBSQLITECIPHER_H #include "dbsqlitecipher_global.h" -#include "plugins/dbplugin.h" +#include "plugins/dbpluginstdfilebase.h" #include "plugins/genericplugin.h" -class DBSQLITECIPHERSHARED_EXPORT DbSqliteCipher : public GenericPlugin, public DbPlugin +class DBSQLITECIPHERSHARED_EXPORT DbSqliteCipher : public GenericPlugin, public DbPluginStdFileBase { Q_OBJECT SQLITESTUDIO_PLUGIN("dbsqlitecipher.json") @@ -15,9 +15,7 @@ class DBSQLITECIPHERSHARED_EXPORT DbSqliteCipher : public GenericPlugin, public QString getLabel() const; bool checkIfDbServedByPlugin(Db* db) const; - Db* getInstance(const QString& name, const QString& path, const QHash& options, QString* errorMessage); QList getOptionsList() const; - QString generateDbName(const QVariant& baseValue); bool init(); void deinit(); @@ -30,6 +28,9 @@ class DBSQLITECIPHERSHARED_EXPORT DbSqliteCipher : public GenericPlugin, public static const int DEF_KDF_ITER = 64000; static_char* DEF_CIPHER = "aes-256-cbc"; + protected: + Db *newInstance(const QString &name, const QString &path, const QHash &options); + private: bool initValid = false; diff --git a/Plugins/DbSqliteCipher/dbsqlitecipher.json b/Plugins/DbSqliteCipher/dbsqlitecipher.json index 332f7c7..1227cc9 100644 --- a/Plugins/DbSqliteCipher/dbsqlitecipher.json +++ b/Plugins/DbSqliteCipher/dbsqlitecipher.json @@ -2,7 +2,7 @@ "type": "DbPlugin", "title": "SQLCipher", "description": "Provides support for databases encrypted with SQLCipher (https://www.zetetic.net/sqlcipher/). See 'About' dialog for SQLCipher license.", - "minAppVersion": 30100, - "version": 10100, + "minAppVersion": 30101, + "version": 10101, "author": "SalSoft" } diff --git a/Plugins/DbSqliteCipher/dbsqlitecipher.qrc b/Plugins/DbSqliteCipher/dbsqlitecipher.qrc index 4d595ef..9c41b50 100644 --- a/Plugins/DbSqliteCipher/dbsqlitecipher.qrc +++ b/Plugins/DbSqliteCipher/dbsqlitecipher.qrc @@ -4,3 +4,6 @@ openssl_lic.txt + + + -- cgit v1.2.3