From cfa64f86da6fcfe04947a634a208705543824810 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Thu, 24 Feb 2022 17:21:46 +0100 Subject: Fix all tests --- lib/connection.cpp | 2 +- lib/database.cpp | 4 ++-- lib/database.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/connection.cpp b/lib/connection.cpp index 1ef2495d..0ef27486 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -579,7 +579,7 @@ void Connection::Private::completeSetup(const QString& mxId) picklingMode = Encrypted { job.binaryData() }; } - database = new Database(data->userId(), q); + database = new Database(data->userId(), data->deviceId(), q); // init olmAccount olmAccount = std::make_unique(data->userId(), data->deviceId(), q); diff --git a/lib/database.cpp b/lib/database.cpp index b91b6ef1..84c93046 100644 --- a/lib/database.cpp +++ b/lib/database.cpp @@ -15,7 +15,7 @@ #include "e2ee/qolminboundsession.h" using namespace Quotient; -Database::Database(const QString& matrixId, QObject* parent) +Database::Database(const QString& matrixId, const QString& deviceId, QObject* parent) : QObject(parent) , m_matrixId(matrixId) { @@ -23,7 +23,7 @@ Database::Database(const QString& matrixId, QObject* parent) QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), QStringLiteral("Quotient_%1").arg(m_matrixId)); QString databasePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/%1").arg(m_matrixId); QDir(databasePath).mkpath(databasePath); - database().setDatabaseName(databasePath + QStringLiteral("/quotient.db3")); + database().setDatabaseName(databasePath + QStringLiteral("/quotient_%1.db3").arg(deviceId)); database().open(); switch(version()) { diff --git a/lib/database.h b/lib/database.h index d244dc0b..d4d5fb56 100644 --- a/lib/database.h +++ b/lib/database.h @@ -14,7 +14,7 @@ class QUOTIENT_API Database : public QObject { Q_OBJECT public: - Database(const QString& matrixId, QObject* parent); + Database(const QString& matrixId, const QString& deviceId, QObject* parent); int version(); void transaction(); -- cgit v1.2.3