From e6b97e33505b83a36a37382dd79dbe68a6cabfb8 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Wed, 30 Dec 2020 02:08:26 +0100 Subject: [PATCH] Fix accountCount not updating correctly --- src/controller.cpp | 2 ++ src/controller.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controller.cpp b/src/controller.cpp index 223abd1f5..737259d96 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -241,6 +241,7 @@ void Controller::addConnection(Connection *c) c->sync(); Q_EMIT connectionAdded(c); + Q_EMIT accountCountChanged(); } void Controller::dropConnection(Connection *c) @@ -249,6 +250,7 @@ void Controller::dropConnection(Connection *c) m_connections.removeOne(c); Q_EMIT connectionDropped(c); + Q_EMIT accountCountChanged(); c->deleteLater(); } diff --git a/src/controller.h b/src/controller.h index 9c6212148..6bb8e98dd 100644 --- a/src/controller.h +++ b/src/controller.h @@ -27,7 +27,7 @@ using namespace Quotient; class Controller : public QObject { Q_OBJECT - Q_PROPERTY(int accountCount READ accountCount NOTIFY connectionAdded NOTIFY connectionDropped) + Q_PROPERTY(int accountCount READ accountCount NOTIFY accountCountChanged) Q_PROPERTY(bool quitOnLastWindowClosed READ quitOnLastWindowClosed WRITE setQuitOnLastWindowClosed NOTIFY quitOnLastWindowClosedChanged) Q_PROPERTY(Connection *activeConnection READ activeConnection WRITE setActiveConnection NOTIFY activeConnectionChanged) Q_PROPERTY(bool busy READ busy WRITE setBusy NOTIFY busyChanged) @@ -98,6 +98,7 @@ Q_SIGNALS: void syncDone(); void connectionAdded(Quotient::Connection *_t1); void connectionDropped(Quotient::Connection *_t1); + void accountCountChanged(); void initiated(); void notificationClicked(const QString &_t1, const QString &_t2); void quitOnLastWindowClosedChanged();