diff options
author | link2xt <link2xt@testrun.org> | 2020-10-27 03:49:48 +0300 |
---|---|---|
committer | link2xt <link2xt@testrun.org> | 2020-10-27 22:09:33 +0300 |
commit | b542a4ed9f079db5c3ddcfae1eab594c61b421f1 (patch) | |
tree | c522912413789edd4a5fe170f50b4477fb91ecfb | |
parent | 4978bb0f6b77466391f74a97d1c5c3ec28a711f5 (diff) | |
download | kdeltachat-b542a4ed9f079db5c3ddcfae1eab594c61b421f1.tar.gz kdeltachat-b542a4ed9f079db5c3ddcfae1eab594c61b421f1.zip |
Set parent for Context
This fixes application termination when account is selected.
-rw-r--r-- | accounts_model.cpp | 2 | ||||
-rw-r--r-- | context.cpp | 4 | ||||
-rw-r--r-- | context.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/accounts_model.cpp b/accounts_model.cpp index d7d4683..f701245 100644 --- a/accounts_model.cpp +++ b/accounts_model.cpp @@ -113,7 +113,7 @@ AccountsModel::getSelectedAccount() { dc_context_t *context = dc_accounts_get_selected_account(m_accounts); - return new Context(context); + return new Context(this, context); } void diff --git a/context.cpp b/context.cpp index 5bb0f44..ad5c2c9 100644 --- a/context.cpp +++ b/context.cpp @@ -5,8 +5,8 @@ Context::Context(QObject *parent) { } -Context::Context(dc_context_t *context) - : QObject(nullptr) +Context::Context(QObject *parent, dc_context_t *context) + : QObject(parent) , m_context(context) { } @@ -16,7 +16,7 @@ class Context : public QObject { public: explicit Context(QObject *parent = nullptr); - explicit Context(dc_context_t *context); + explicit Context(QObject *parent, dc_context_t *context); ~Context(); Q_INVOKABLE void configure(); |