Fix accountCount not updating correctly

This commit is contained in:
Tobias Fella
2020-12-30 02:08:26 +01:00
committed by Carl Schwan
parent ecd6a63564
commit 45c35b3cbe
2 changed files with 4 additions and 1 deletions

View File

@@ -236,6 +236,7 @@ void Controller::addConnection(Connection *c)
c->sync(); c->sync();
Q_EMIT connectionAdded(c); Q_EMIT connectionAdded(c);
Q_EMIT accountCountChanged();
} }
void Controller::dropConnection(Connection *c) void Controller::dropConnection(Connection *c)
@@ -244,6 +245,7 @@ void Controller::dropConnection(Connection *c)
m_connections.removeOne(c); m_connections.removeOne(c);
Q_EMIT connectionDropped(c); Q_EMIT connectionDropped(c);
Q_EMIT accountCountChanged();
c->deleteLater(); c->deleteLater();
} }

View File

@@ -27,7 +27,7 @@ using namespace Quotient;
class Controller : public QObject class Controller : public QObject
{ {
Q_OBJECT 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(bool quitOnLastWindowClosed READ quitOnLastWindowClosed WRITE setQuitOnLastWindowClosed NOTIFY quitOnLastWindowClosedChanged)
Q_PROPERTY(Connection *activeConnection READ activeConnection WRITE setActiveConnection NOTIFY activeConnectionChanged) Q_PROPERTY(Connection *activeConnection READ activeConnection WRITE setActiveConnection NOTIFY activeConnectionChanged)
Q_PROPERTY(bool busy READ busy WRITE setBusy NOTIFY busyChanged) Q_PROPERTY(bool busy READ busy WRITE setBusy NOTIFY busyChanged)
@@ -103,6 +103,7 @@ Q_SIGNALS:
void syncDone(); void syncDone();
void connectionAdded(Quotient::Connection *_t1); void connectionAdded(Quotient::Connection *_t1);
void connectionDropped(Quotient::Connection *_t1); void connectionDropped(Quotient::Connection *_t1);
void accountCountChanged();
void initiated(); void initiated();
void notificationClicked(const QString &_t1, const QString &_t2); void notificationClicked(const QString &_t1, const QString &_t2);
void quitOnLastWindowClosedChanged(); void quitOnLastWindowClosedChanged();