From 450c2bdf68fb837cb64fb3190912564ecc9f651e Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 30 May 2018 22:18:55 +0200 Subject: [PATCH] core: Change signature of Core::syncTimer() Returning a pointer is more consistent with the rest of the code base and established patterns than returning a non-const reference. --- src/core/core.h | 5 +++-- src/core/coresession.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/core.h b/src/core/core.h index dad8ee2d..53869c2b 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -686,7 +686,7 @@ public: static QString setup(const QString &adminUser, const QString &adminPassword, const QString &backend, const QVariantMap &setupData, const QString &authenticator, const QVariantMap &authSetupMap); - static inline QTimer &syncTimer() { return instance()->_storageSyncTimer; } + static inline QTimer *syncTimer() { return &instance()->_storageSyncTimer; } inline OidentdConfigGenerator *oidentdConfigGenerator() const { return _oidentdConfigGenerator; } @@ -779,9 +779,10 @@ private: QHash _sessions; DeferredSharedPtr _storage; ///< Active storage backend DeferredSharedPtr _authenticator; ///< Active authenticator - QTimer _storageSyncTimer; QMap _authUserNames; + QTimer _storageSyncTimer; + #ifdef HAVE_SSL SslServer _server, _v6server; #else diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 929895ae..689f043e 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -131,7 +131,7 @@ CoreSession::CoreSession(UserId uid, bool restoreState, bool strictIdentEnabled, eventManager()->registerObject(ctcpParser(), EventManager::LowPriority, "send"); // periodically save our session state - connect(&(Core::instance()->syncTimer()), SIGNAL(timeout()), this, SLOT(saveSessionState())); + connect(Core::instance()->syncTimer(), SIGNAL(timeout()), this, SLOT(saveSessionState())); p->synchronize(_bufferSyncer); p->synchronize(&aliasManager()); -- 2.20.1