From 1fdc150116cad39aae5c5da407c3312b47a59e3a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Fri, 17 Dec 2021 07:06:30 -0500 Subject: New upstream version 3.3.3+dfsg1. --- .../dbsqlitesystemdatainstance.cpp | 31 ---------------------- 1 file changed, 31 deletions(-) delete mode 100644 Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp (limited to 'Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp') diff --git a/Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp b/Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp deleted file mode 100644 index 2295006..0000000 --- a/Plugins/DbSqliteSystemData/dbsqlitesystemdatainstance.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "dbsqlitesystemdatainstance.h" -#include "dbsqlitesystemdata.h" - -DbSqliteSystemDataInstance::DbSqliteSystemDataInstance(const QString& name, const QString& path, const QHash& connOptions) : - AbstractDb3(name, path, connOptions) -{ -} - -void DbSqliteSystemDataInstance::initAfterOpen() -{ - SqlQueryPtr res; - - QString key = connOptions[DbSqliteSystemData::PASSWORD_OPT].toString(); - if (!key.isEmpty()) - { - res = exec(QString("PRAGMA key = '%1';").arg(key), Flag::NO_LOCK); - if (res->isError()) - qWarning() << "Error while defining WxSqlite3 key:" << res->getErrorText(); - } - - AbstractDb3::initAfterOpen(); -} - -QString DbSqliteSystemDataInstance::getAttachSql(Db *otherDb, const QString &generatedAttachName) -{ - QString pass = ""; - if (otherDb->getConnectionOptions().contains(DbSqliteSystemData::PASSWORD_OPT)) - pass = otherDb->getConnectionOptions()[DbSqliteSystemData::PASSWORD_OPT].toString().replace("'", "''"); - - return QString("ATTACH '%1' AS %2 KEY '%3';").arg(otherDb->getPath(), generatedAttachName, pass); -} -- cgit v1.2.3