From 980b2997b78e8a1e4322fa7b25ba8c4d5199318d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 19 Jul 2018 08:46:51 +0900 Subject: Connection::stateChanged() signal Also: as of the previous commit, we officially bump API version to 0.4 --- lib/connection.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib/connection.h') diff --git a/lib/connection.h b/lib/connection.h index aec67972..c7e28282 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -61,10 +61,10 @@ namespace QMatrixClient /** Whether or not the rooms state should be cached locally * \sa loadState(), saveState() */ - Q_PROPERTY(User* localUser READ user CONSTANT) - Q_PROPERTY(QString localUserId READ userId CONSTANT) - Q_PROPERTY(QString deviceId READ deviceId CONSTANT) - Q_PROPERTY(QByteArray accessToken READ accessToken CONSTANT) + Q_PROPERTY(User* localUser READ user NOTIFY stateChanged) + Q_PROPERTY(QString localUserId READ userId NOTIFY stateChanged) + Q_PROPERTY(QString deviceId READ deviceId NOTIFY stateChanged) + Q_PROPERTY(QByteArray accessToken READ accessToken NOTIFY stateChanged) Q_PROPERTY(QUrl homeserver READ homeserver WRITE setHomeserver NOTIFY homeserverChanged) Q_PROPERTY(bool cacheState READ cacheState WRITE setCacheState NOTIFY cacheStateChanged) public: @@ -431,6 +431,13 @@ namespace QMatrixClient void connected(); void reconnected(); //< \deprecated Use connected() instead void loggedOut(); + /** Login data or state have changed + * + * This is a common change signal for userId, deviceId and + * accessToken - these properties normally only change at + * a successful login and logout and are constant at other times. + */ + void stateChanged(); void loginError(QString message, QByteArray details); /** A network request (job) failed -- cgit v1.2.3