aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/accountregistry.cpp7
-rw-r--r--lib/accountregistry.h2
-rw-r--r--lib/connection.cpp1
3 files changed, 1 insertions, 9 deletions
diff --git a/lib/accountregistry.cpp b/lib/accountregistry.cpp
index 2cab54a3..ad7c5f99 100644
--- a/lib/accountregistry.cpp
+++ b/lib/accountregistry.cpp
@@ -135,10 +135,3 @@ QStringList AccountRegistry::accountsLoading() const
{
return m_accountsLoading;
}
-
-AccountRegistry::~AccountRegistry()
-{
- for (const auto& connection : *this) {
- connection->saveState();
- }
-}
diff --git a/lib/accountregistry.h b/lib/accountregistry.h
index 959c7d42..38cfe6c6 100644
--- a/lib/accountregistry.h
+++ b/lib/accountregistry.h
@@ -42,8 +42,6 @@ public:
[[deprecated("Use Accounts variable instead")]] //
static AccountRegistry& instance();
- ~AccountRegistry();
-
// Expose most of QVector's const-API but only provide add() and drop()
// for changing it. In theory other changing operations could be supported
// too; but then boilerplate begin/end*() calls has to be tucked into each
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 7885718f..101bef89 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -611,6 +611,7 @@ void Connection::Private::completeSetup(const QString& mxId)
<< "by user" << data->userId()
<< "from device" << data->deviceId();
Accounts.add(q);
+ connect(qApp, &QCoreApplication::aboutToQuit, q, &Connection::saveState);
#ifndef Quotient_E2EE_ENABLED
qCWarning(E2EE) << "End-to-end encryption (E2EE) support is turned off.";
#else // Quotient_E2EE_ENABLED