common: Simplify SyncableObject macros and usage
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 23 Aug 2018 21:40:36 +0000 (23:40 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
Since the C++11 standard defines "__func__", and modern versions
of MSVC support this, we can remove the workaround for MSVC from
the SyncableObject macros. It is no longer necessary to derive
the function name from MSVC's __FUNCTION__ (which contains the
enclosing class name), and thus the _classNameOffset__ function
declared by the SYNCABLE_OBJECT macro is no longer needed.

Repurpose the macro to define the syncMetaObject() member function
instead, and remove the no-longer needed INIT_SYNCABLE_OBJECT
macro.
The syncMetaObject() function is used by the signal proxy for
accessing the metaObject() of the base class in case there are
client- or core-specific specializations of a syncable object;
i.e. if you have Foo directly inheriting from SyncableObject,
and ClientFoo derived from Foo, the function must only be
declared in Foo, otherwise syncing won't work.

Thus, the SYNCABLE_OBJECT macro declares the function as final,
so it can't be accidentally overridden.

While we're at it, replace include guards with #pragma once in
files we touched.

82 files changed:
src/client/clientaliasmanager.cpp
src/client/clientaliasmanager.h
src/client/clientbacklogmanager.cpp
src/client/clientbacklogmanager.h
src/client/clientbufferviewconfig.cpp
src/client/clientbufferviewconfig.h
src/client/clientbufferviewmanager.cpp
src/client/clientbufferviewmanager.h
src/client/clientidentity.cpp
src/client/clientidentity.h
src/client/clientignorelistmanager.cpp
src/client/clientignorelistmanager.h
src/client/clientirclisthelper.cpp
src/client/clientirclisthelper.h
src/client/clienttransfer.cpp
src/client/clienttransfer.h
src/client/clienttransfermanager.cpp
src/client/clienttransfermanager.h
src/common/aliasmanager.cpp
src/common/aliasmanager.h
src/common/backlogmanager.cpp
src/common/backlogmanager.h
src/common/buffersyncer.cpp
src/common/buffersyncer.h
src/common/bufferviewconfig.cpp
src/common/bufferviewconfig.h
src/common/bufferviewmanager.cpp
src/common/bufferviewmanager.h
src/common/coreinfo.cpp
src/common/dccconfig.cpp
src/common/dccconfig.h
src/common/highlightrulemanager.cpp
src/common/highlightrulemanager.h
src/common/identity.cpp
src/common/identity.h
src/common/ignorelistmanager.cpp
src/common/ignorelistmanager.h
src/common/ircchannel.cpp
src/common/ircchannel.h
src/common/irclisthelper.cpp
src/common/irclisthelper.h
src/common/ircuser.cpp
src/common/ircuser.h
src/common/network.cpp
src/common/network.h
src/common/networkconfig.cpp
src/common/networkconfig.h
src/common/syncableobject.cpp
src/common/syncableobject.h
src/common/transfer.cpp
src/common/transfer.h
src/common/transfermanager.cpp
src/common/transfermanager.h
src/core/corealiasmanager.cpp
src/core/corealiasmanager.h
src/core/corebacklogmanager.cpp
src/core/corebacklogmanager.h
src/core/corebuffersyncer.cpp
src/core/corebuffersyncer.h
src/core/corebufferviewconfig.cpp
src/core/corebufferviewconfig.h
src/core/corebufferviewmanager.cpp
src/core/corebufferviewmanager.h
src/core/corehighlightrulemanager.cpp
src/core/corehighlightrulemanager.h
src/core/coreidentity.cpp
src/core/coreidentity.h
src/core/coreignorelistmanager.cpp
src/core/coreignorelistmanager.h
src/core/coreircchannel.cpp
src/core/coreircchannel.h
src/core/coreirclisthelper.cpp
src/core/coreirclisthelper.h
src/core/coreircuser.h
src/core/corenetwork.cpp
src/core/corenetwork.h
src/core/corenetworkconfig.cpp
src/core/corenetworkconfig.h
src/core/coretransfer.cpp
src/core/coretransfer.h
src/core/coretransfermanager.cpp
src/core/coretransfermanager.h

index 729410d..d3c4d08 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "client.h"
 
-INIT_SYNCABLE_OBJECT(ClientAliasManager)
 ClientAliasManager::ClientAliasManager(QObject *parent)
     : AliasManager(parent)
 {
index cc84b8f..9fcb768 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLIENTALIASMANAGER_H
-#define CLIENTALIASMANAGER_H
+#pragma once
 
 #include "aliasmanager.h"
 
 class ClientAliasManager : public AliasManager
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     explicit ClientAliasManager(QObject *parent = 0);
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &AliasManager::staticMetaObject; }
-
 protected:
     const Network *network(NetworkId) const;
 };
-
-
-#endif //CLIENTALIASMANAGER_H
index 32dbfde..c36763d 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <QDebug>
 
-INIT_SYNCABLE_OBJECT(ClientBacklogManager)
 ClientBacklogManager::ClientBacklogManager(QObject *parent)
     : BacklogManager(parent),
     _requester(0),
index 080bbcf..cce66f0 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLIENTBACKLOGMANAGER_H
-#define CLIENTBACKLOGMANAGER_H
+#pragma once
 
 #include "backlogmanager.h"
 #include "message.h"
@@ -28,8 +27,7 @@ class BacklogRequester;
 
 class ClientBacklogManager : public BacklogManager
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     ClientBacklogManager(QObject *parent = 0);
@@ -73,6 +71,3 @@ inline void ClientBacklogManager::checkForBacklog(BufferId bufferId)
 {
     checkForBacklog(BufferIdList() << bufferId);
 }
-
-
-#endif // CLIENTBACKLOGMANAGER_H
index 398e2c6..161ba18 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "clientbufferviewconfig.h"
 
-INIT_SYNCABLE_OBJECT(ClientBufferViewConfig)
 ClientBufferViewConfig::ClientBufferViewConfig(int bufferViewId, QObject *parent)
     : BufferViewConfig(bufferViewId, parent),
     _locked(false)
index 1dd65c3..44ee211 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLIENTBUFFERVIEWCONFIG_H
-#define CLIENTBUFFERVIEWCONFIG_H
+#pragma once
 
 #include "bufferviewconfig.h"
 
 class ClientBufferViewConfig : public BufferViewConfig
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     ClientBufferViewConfig(int bufferViewId, QObject *parent = 0);
@@ -42,6 +40,3 @@ private slots:
 private:
     bool _locked;
 };
-
-
-#endif //CLIENTBUFFERVIEWCONFIG_H
index ea1dafd..d1975f6 100644 (file)
@@ -24,7 +24,6 @@
 #include "client.h"
 #include "networkmodel.h"
 
-INIT_SYNCABLE_OBJECT(ClientBufferViewManager)
 ClientBufferViewManager::ClientBufferViewManager(SignalProxy *proxy, QObject *parent)
     : BufferViewManager(proxy, parent)
 {
index 2ce62f7..6f26710 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLIENTBUFFERVIEWMANAGER_H
-#define CLIENTBUFFERVIEWMANAGER_H
+#pragma once
 
 #include "bufferviewmanager.h"
 
@@ -28,8 +27,7 @@ class BufferViewOverlay;
 
 class ClientBufferViewManager : public BufferViewManager
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     ClientBufferViewManager(SignalProxy *proxy, QObject *parent = 0);
@@ -43,6 +41,3 @@ public slots:
 protected:
     virtual BufferViewConfig *bufferViewConfigFactory(int bufferViewConfigId);
 };
-
-
-#endif //CLIENTBUFFERVIEWMANAGER_H
index 08a24b7..04b946e 100644 (file)
@@ -23,7 +23,6 @@
 #include "client.h"
 #include "signalproxy.h"
 
-INIT_SYNCABLE_OBJECT(CertIdentity)
 CertIdentity::CertIdentity(IdentityId id, QObject *parent)
     : Identity(id, parent)
 #ifdef HAVE_SSL
index cfb064c..9f6fdc0 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLIENTIDENTITY_H
-#define CLIENTIDENTITY_H
+#pragma once
 
 #include "identity.h"
 
@@ -27,8 +26,7 @@ class ClientCertManager;
 
 class CertIdentity : public Identity
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CertIdentity(IdentityId id = 0, QObject *parent = 0);
@@ -89,7 +87,4 @@ private:
     CertIdentity *_certIdentity;
 };
 
-
 #endif //HAVE_SSL
-
-#endif //CLIENTIDENTITY_H
index 461f629..93463af 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "clientignorelistmanager.h"
 
-INIT_SYNCABLE_OBJECT(ClientIgnoreListManager)
-
 ClientIgnoreListManager::ClientIgnoreListManager(QObject *parent)
     : IgnoreListManager(parent)
 {
index 49b0164..29cd51f 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLIENTIGNORELISTMANAGER_H
-#define CLIENTIGNORELISTMANAGER_H
+#pragma once
 
 #include "ignorelistmanager.h"
 #include <QMap>
 
 class ClientIgnoreListManager : public IgnoreListManager
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     explicit ClientIgnoreListManager(QObject *parent = 0);
-    inline virtual const QMetaObject *syncMetaObject() const { return &IgnoreListManager::staticMetaObject; }
 
     //! Fetch all matching ignore rules for a given hostmask
     /** \param hostmask The hostmask of the user
@@ -48,6 +45,3 @@ private:
     // matches an ignore rule against a given string
     bool pureMatch(const IgnoreListItem &item, const QString &string) const;
 };
-
-
-#endif // CLIENTIGNORELISTMANAGER_H
index acfb73e..1e842e3 100644 (file)
@@ -25,7 +25,6 @@
 #include "client.h"
 #include "irclistmodel.h"
 
-INIT_SYNCABLE_OBJECT(ClientIrcListHelper)
 QVariantList ClientIrcListHelper::requestChannelList(const NetworkId &netId, const QStringList &channelFilters)
 {
     _netId = netId;
index 932121b..47d18d7 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLIENTIRCLISTHELPER_H
-#define CLIENTIRCLISTHELPER_H
+#pragma once
 
 #include "irclisthelper.h"
 
 class ClientIrcListHelper : public IrcListHelper
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     inline ClientIrcListHelper(QObject *object = 0) : IrcListHelper(object) {};
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &IrcListHelper::staticMetaObject; }
-
 public slots:
     virtual QVariantList requestChannelList(const NetworkId &netId, const QStringList &channelFilters);
     virtual void receiveChannelList(const NetworkId &netId, const QStringList &channelFilters, const QVariantList &channels);
@@ -47,6 +43,3 @@ signals:
 private:
     NetworkId _netId;
 };
-
-
-#endif //CLIENTIRCLISTHELPER_H
index e25da81..1eba778 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "clienttransfer.h"
 
-INIT_SYNCABLE_OBJECT(ClientTransfer)
 ClientTransfer::ClientTransfer(const QUuid &uuid, QObject *parent)
     : Transfer(uuid, parent),
     _file(0)
index 780a5b6..567797f 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLIENTTRANSFER_H
-#define CLIENTTRANSFER_H
+#pragma once
 
 #include <QUuid>
 
@@ -30,7 +29,6 @@ class QFile;
 class ClientTransfer : public Transfer
 {
     Q_OBJECT
-    SYNCABLE_OBJECT
 
 public:
     ClientTransfer(const QUuid &uuid, QObject *parent = 0);
@@ -55,5 +53,3 @@ private:
 
     QFile *_file;
 };
-
-#endif
index 346ec98..9042b29 100644 (file)
@@ -23,8 +23,6 @@
 #include "client.h"
 #include "clienttransfer.h"
 
-INIT_SYNCABLE_OBJECT(ClientTransferManager)
-
 void ClientTransferManager::setTransferIds(const QList<QUuid> &transferIds)
 {
     for(auto &&id : transferIds) {
index 218ea0d..8f38444 100644 (file)
@@ -27,7 +27,6 @@
 class ClientTransferManager : public TransferManager
 {
     Q_OBJECT
-    SYNCABLE_OBJECT
 
 public:
     using TransferManager::TransferManager;
index 359db28..efb148f 100644 (file)
@@ -24,7 +24,6 @@
 #include "aliasmanager.h"
 #include "network.h"
 
-INIT_SYNCABLE_OBJECT(AliasManager)
 AliasManager &AliasManager::operator=(const AliasManager &other)
 {
     if (this == &other)
index df5c03d..0a93789 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef ALIASMANAGER_H
-#define ALIASMANAGER_H
+#pragma once
 
 #include <QVariantMap>
 
@@ -30,8 +29,8 @@ class Network;
 
 class AliasManager : public SyncableObject
 {
+    Q_OBJECT
     SYNCABLE_OBJECT
-        Q_OBJECT
 
 public:
     inline AliasManager(QObject *parent = 0) : SyncableObject(parent) { setAllowClientUpdates(true); }
@@ -75,6 +74,3 @@ private:
 
     AliasList _aliases;
 };
-
-
-#endif //ALIASMANAGER_H
index 2ea49d5..ffa9de4 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "backlogmanager.h"
 
-INIT_SYNCABLE_OBJECT(BacklogManager)
 QVariantList BacklogManager::requestBacklog(BufferId bufferId, MsgId first, MsgId last, int limit, int additional)
 {
     REQUEST(ARG(bufferId), ARG(first), ARG(last), ARG(limit), ARG(additional))
index 1aa5d43..ecee40d 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef BACKLOGMANAGER_H
-#define BACKLOGMANAGER_H
+#pragma once
 
 #include "syncableobject.h"
 #include "types.h"
 
 class BacklogManager : public SyncableObject
 {
+    Q_OBJECT
     SYNCABLE_OBJECT
-        Q_OBJECT
 
 public:
     BacklogManager(QObject *parent = 0) : SyncableObject(parent) {}
-    inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
 
 public slots:
     virtual QVariantList requestBacklog(BufferId bufferId, MsgId first = -1, MsgId last = -1, int limit = -1, int additional = 0);
@@ -48,6 +46,3 @@ signals:
     void backlogRequested(BufferId, MsgId, MsgId, int, int);
     void backlogAllRequested(MsgId, MsgId, int, int);
 };
-
-
-#endif // BACKLOGMANAGER_H
index 3f437d9..5c3a7d3 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "buffersyncer.h"
 
-INIT_SYNCABLE_OBJECT(BufferSyncer)
 BufferSyncer::BufferSyncer(QObject *parent)
     : SyncableObject(parent)
 {
index 9ca0c01..5d4f383 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef BUFFERSYNCER_H_
-#define BUFFERSYNCER_H_
+#pragma once
 
 #include "syncableobject.h"
 #include "types.h"
 
 class BufferSyncer : public SyncableObject
 {
+    Q_OBJECT
     SYNCABLE_OBJECT
-        Q_OBJECT
 
 public:
     explicit BufferSyncer(QObject *parent);
     explicit BufferSyncer(const QHash<BufferId, MsgId> &lastSeenMsg, const QHash<BufferId, MsgId> &markerLines, const QHash<BufferId, Message::Types> &activities, const QHash<BufferId, int> &highlightCounts, QObject *parent);
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
-
     MsgId lastSeenMsg(BufferId buffer) const;
     MsgId markerLine(BufferId buffer) const;
     Message::Types activity(BufferId buffer) const;
@@ -121,6 +118,3 @@ private:
     QHash<BufferId, Message::Types> _bufferActivities;
     QHash<BufferId, int> _highlightCounts;
 };
-
-
-#endif
index 95cee70..5bb9b1e 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "bufferviewconfig.h"
 
-INIT_SYNCABLE_OBJECT(BufferViewConfig)
 BufferViewConfig::BufferViewConfig(int bufferViewId, QObject *parent)
     : SyncableObject(parent),
     _bufferViewId(bufferViewId)
index 71a8eab..d2542e7 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef BUFFERVIEWCONFIG_H
-#define BUFFERVIEWCONFIG_H
+#pragma once
 
 #include "syncableobject.h"
 
@@ -28,8 +27,8 @@
 
 class BufferViewConfig : public SyncableObject
 {
-    SYNCABLE_OBJECT
     Q_OBJECT
+    SYNCABLE_OBJECT
 
     Q_PROPERTY(QString bufferViewName READ bufferViewName WRITE setBufferViewName)
     Q_PROPERTY(NetworkId networkId READ networkId WRITE setNetworkId)
@@ -43,11 +42,9 @@ class BufferViewConfig : public SyncableObject
     Q_PROPERTY(bool showSearch READ showSearch WRITE setShowSearch)
 
 public :
-        BufferViewConfig(int bufferViewId, QObject *parent = 0);
+    BufferViewConfig(int bufferViewId, QObject *parent = 0);
     BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = 0);
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
-
 public slots:
     inline int bufferViewId() const { return _bufferViewId; }
 
@@ -149,6 +146,3 @@ private:
     QSet<BufferId> _removedBuffers;
     QSet<BufferId> _temporarilyRemovedBuffers;
 };
-
-
-#endif // BUFFERVIEWCONFIG_H
index 41cdd46..ba1b6c2 100644 (file)
@@ -23,7 +23,6 @@
 #include "bufferviewconfig.h"
 #include "signalproxy.h"
 
-INIT_SYNCABLE_OBJECT(BufferViewManager)
 BufferViewManager::BufferViewManager(SignalProxy *proxy, QObject *parent)
     : SyncableObject(parent),
     _proxy(proxy)
index 8f83622..4e41e98 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef BUFFERVIEWMANAGER_H
-#define BUFFERVIEWMANAGER_H
+#pragma once
 
 #include "syncableobject.h"
 
@@ -31,14 +30,12 @@ class SignalProxy;
 
 class BufferViewManager : public SyncableObject
 {
+    Q_OBJECT
     SYNCABLE_OBJECT
-        Q_OBJECT
 
 public:
     BufferViewManager(SignalProxy *proxy, QObject *parent = 0);
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
-
     inline QList<BufferViewConfig *> bufferViewConfigs() const { return _bufferViewConfigs.values(); }
     BufferViewConfig *bufferViewConfig(int bufferViewId) const;
 
@@ -73,6 +70,3 @@ private:
     BufferViewConfigHash _bufferViewConfigs;
     SignalProxy *_proxy;
 };
-
-
-#endif // BUFFERVIEWMANAGER_H
index cfa86ab..d4339d1 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "coreinfo.h"
 
-INIT_SYNCABLE_OBJECT(CoreInfo)
 CoreInfo::CoreInfo(QObject *parent) : SyncableObject(parent) {}
 
 QVariantMap CoreInfo::coreData() const
index e1f8380..7767735 100644 (file)
@@ -24,8 +24,6 @@
 
 #include "types.h"
 
-INIT_SYNCABLE_OBJECT(DccConfig)
-
 DccConfig::DccConfig(QObject *parent)
     : SyncableObject(parent)
 {
index 7512691..c82830a 100644 (file)
@@ -84,9 +84,6 @@ public:
      */
     DccConfig(QObject *parent = nullptr);
 
-    // see base class
-    const QMetaObject *syncMetaObject() const override { return &staticMetaObject; }
-
     /**
      * Assignment operator.
      *
index d3c2384..0d0e7be 100644 (file)
@@ -25,8 +25,6 @@
 #include "expressionmatch.h"
 #include "util.h"
 
-INIT_SYNCABLE_OBJECT(HighlightRuleManager)
-
 HighlightRuleManager &HighlightRuleManager::operator=(const HighlightRuleManager &other)
 {
     if (this == &other)
index d98c867..d8d8859 100644 (file)
@@ -34,8 +34,8 @@
 
 class HighlightRuleManager : public SyncableObject
 {
-    SYNCABLE_OBJECT
     Q_OBJECT
+    SYNCABLE_OBJECT
 
     Q_PROPERTY(int highlightNick READ highlightNick WRITE setHighlightNick)
     Q_PROPERTY(bool nicksCaseSensitive READ nicksCaseSensitive WRITE setNicksCaseSensitive)
index 7f1cac6..e2cd936 100644 (file)
@@ -42,7 +42,6 @@
 #  include <Security.h>
 #endif
 
-INIT_SYNCABLE_OBJECT(Identity)
 Identity::Identity(IdentityId id, QObject *parent)
     : SyncableObject(parent),
     _identityId(id)
@@ -389,8 +388,3 @@ QDataStream &operator>>(QDataStream &in, Identity &id)
     id.fromVariantMap(i);
     return in;
 }
-
-
-#ifdef HAVE_SSL
-INIT_SYNCABLE_OBJECT(CertManager)
-#endif // HAVE_SSL
index f095620..4c5de2c 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef IDENTITY_H
-#define IDENTITY_H
+#pragma once
 
 #include <QByteArray>
 #include <QDataStream>
@@ -32,8 +31,8 @@
 
 class Identity : public SyncableObject
 {
-    SYNCABLE_OBJECT
     Q_OBJECT
+    SYNCABLE_OBJECT
 
     Q_PROPERTY(IdentityId identityId READ id WRITE setId)
     Q_PROPERTY(QString identityName READ identityName WRITE setIdentityName)
@@ -56,9 +55,8 @@ class Identity : public SyncableObject
     Q_PROPERTY(QString quitReason READ quitReason WRITE setQuitReason)
 
 public :
-        Identity(IdentityId id = 0, QObject *parent = 0);
+    Identity(IdentityId id = 0, QObject *parent = 0);
     Identity(const Identity &other, QObject *parent = 0);
-    inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
 
     void setToDefaults();
 
@@ -167,14 +165,14 @@ Q_DECLARE_METATYPE(Identity)
 
 class CertManager : public SyncableObject
 {
-    SYNCABLE_OBJECT
     Q_OBJECT
+    SYNCABLE_OBJECT
+
     Q_PROPERTY(QByteArray sslKey READ sslKeyPem WRITE setSslKey)
     Q_PROPERTY(QByteArray sslCert READ sslCertPem WRITE setSslCert)
 
 public :
-        CertManager(IdentityId id, QObject *parent = 0) : SyncableObject(QString::number(id.toInt()), parent) {}
-    inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
+    CertManager(IdentityId id, QObject *parent = 0) : SyncableObject(QString::number(id.toInt()), parent) {}
 
     virtual const QSslKey &sslKey() const = 0;
     inline QByteArray sslKeyPem() const { return sslKey().toPem(); }
@@ -186,7 +184,4 @@ public slots:
     inline virtual void setSslCert(const QByteArray &encoded) { SYNC(ARG(encoded)) }
 };
 
-
 #endif // HAVE_SSL
-
-#endif // IDENTITY_H
index 63750f6..4871b74 100644 (file)
@@ -24,7 +24,6 @@
 #include <QDebug>
 #include <QStringList>
 
-INIT_SYNCABLE_OBJECT(IgnoreListManager)
 IgnoreListManager &IgnoreListManager::operator=(const IgnoreListManager &other)
 {
     if (this == &other)
index baf3cc1..3a3844f 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef IGNORELISTMANAGER_H
-#define IGNORELISTMANAGER_H
+#pragma once
 
 #include <QDebug>
 #include <QString>
@@ -32,8 +31,9 @@
 
 class IgnoreListManager : public SyncableObject
 {
+    Q_OBJECT
     SYNCABLE_OBJECT
-        Q_OBJECT
+
 public:
     inline IgnoreListManager(QObject *parent = 0) : SyncableObject(parent) { setAllowClientUpdates(true); }
     IgnoreListManager &operator=(const IgnoreListManager &other);
@@ -406,6 +406,3 @@ signals:
 private:
     IgnoreList _ignoreList;
 };
-
-
-#endif // IGNORELISTMANAGER_H
index 0932306..92a4944 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <QDebug>
 
-INIT_SYNCABLE_OBJECT(IrcChannel)
 IrcChannel::IrcChannel(const QString &channelname, Network *network)
     : SyncableObject(network),
     _initialized(false),
index 36aa864..68c3683 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef IRCCHANNEL_H
-#define IRCCHANNEL_H
+#pragma once
 
 #include <QHash>
 #include <QSet>
@@ -34,8 +33,8 @@ class Network;
 
 class IrcChannel : public SyncableObject
 {
-    SYNCABLE_OBJECT
     Q_OBJECT
+    SYNCABLE_OBJECT
 
     Q_PROPERTY(QString name READ name)
     Q_PROPERTY(QString topic READ topic WRITE setTopic)
@@ -150,6 +149,3 @@ private:
     QHash<QChar, QString> _C_channelModes;
     QSet<QChar> _D_channelModes;
 };
-
-
-#endif
index 4edf101..c169d3b 100644 (file)
@@ -19,5 +19,3 @@
  ***************************************************************************/
 
 #include "irclisthelper.h"
-
-INIT_SYNCABLE_OBJECT(IrcListHelper)
index 7837dd9..037daf7 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef IRCLISTHELPER_H
-#define IRCLISTHELPER_H
+#pragma once
 
 #include "syncableobject.h"
 #include "types.h"
@@ -34,8 +33,8 @@
  */
 class IrcListHelper : public SyncableObject
 {
+    Q_OBJECT
     SYNCABLE_OBJECT
-        Q_OBJECT
 
 public:
     inline IrcListHelper(QObject *parent = 0) : SyncableObject(parent) { setInitialized(); };
@@ -53,6 +52,3 @@ public slots:
     inline virtual void reportFinishedList(const NetworkId &netId) { SYNC(ARG(netId)) }
     inline virtual void reportError(const QString &error) { SYNC(ARG(error)) }
 };
-
-
-#endif //IRCLISTHELPER_H
index 65dcbe1..18a066b 100644 (file)
@@ -28,7 +28,6 @@
 #include <QTextCodec>
 #include <QDebug>
 
-INIT_SYNCABLE_OBJECT(IrcUser)
 IrcUser::IrcUser(const QString &hostmask, Network *network) : SyncableObject(network),
     _initialized(false),
     _nick(nickFromMask(hostmask)),
index 652cf85..4162a85 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef IRCUSER_H
-#define IRCUSER_H
+#pragma once
 
 #include <QSet>
 #include <QString>
@@ -36,8 +35,8 @@ class IrcChannel;
 
 class IrcUser : public SyncableObject
 {
-    SYNCABLE_OBJECT
     Q_OBJECT
+    SYNCABLE_OBJECT
 
     Q_PROPERTY(QString user READ user WRITE setUser)
     Q_PROPERTY(QString host READ host WRITE setHost)
@@ -261,6 +260,3 @@ private:
     /// Tracks if changes in away state (away/here, message) have yet to be acknowledged
     bool _awayChanged = true;
 };
-
-
-#endif
index f2a8e1f..d7c0980 100644 (file)
@@ -32,7 +32,7 @@ QTextCodec *Network::_defaultCodecForDecoding = 0;
 // ====================
 //  Public:
 // ====================
-INIT_SYNCABLE_OBJECT(Network)
+
 Network::Network(const NetworkId &networkid, QObject *parent)
     : SyncableObject(parent),
     _proxy(0),
index eaa427c..80e4686 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef NETWORK_H
-#define NETWORK_H
+#pragma once
 
 #include <QString>
 #include <QStringList>
@@ -49,8 +48,9 @@ struct NetworkInfo;
 
 class Network : public SyncableObject
 {
-    SYNCABLE_OBJECT
     Q_OBJECT
+    SYNCABLE_OBJECT
+
     Q_ENUMS(ConnectionState)
 
     Q_PROPERTY(QString networkName READ networkName WRITE setNetworkName)
@@ -807,5 +807,3 @@ QDataStream &operator<<(QDataStream &out, const Network::Server &server);
 QDataStream &operator>>(QDataStream &in, Network::Server &server);
 QDebug operator<<(QDebug dbg, const Network::Server &server);
 Q_DECLARE_METATYPE(Network::Server)
-
-#endif
index 345336e..b8170cb 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "networkconfig.h"
 
-INIT_SYNCABLE_OBJECT(NetworkConfig)
 NetworkConfig::NetworkConfig(const QString &objectName, QObject *parent)
     : SyncableObject(objectName, parent),
     _pingTimeoutEnabled(true),
index a16a3fa..5f234f5 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef NETWORKCONFIG_H_
-#define NETWORKCONFIG_H_
+#pragma once
 
 #include "syncableobject.h"
 
 class NetworkConfig : public SyncableObject
 {
-    SYNCABLE_OBJECT
     Q_OBJECT
+    SYNCABLE_OBJECT
 
     Q_PROPERTY(bool pingTimeoutEnabled READ pingTimeoutEnabled WRITE setPingTimeoutEnabled)
     Q_PROPERTY(int pingInterval READ pingInterval WRITE setPingInterval)
@@ -38,9 +37,7 @@ class NetworkConfig : public SyncableObject
     Q_PROPERTY(bool standardCtcp READ standardCtcp WRITE setStandardCtcp)
 
 public :
-        NetworkConfig(const QString &objectName = "GlobalNetworkConfig", QObject *parent = 0);
-
-    inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
+    NetworkConfig(const QString &objectName = "GlobalNetworkConfig", QObject *parent = 0);
 
 public slots:
     inline bool pingTimeoutEnabled() const { return _pingTimeoutEnabled; }
@@ -105,6 +102,3 @@ private:
 
     bool _standardCtcp;
 };
-
-
-#endif
index ba05014..9394659 100644 (file)
@@ -27,7 +27,6 @@
 #include "signalproxy.h"
 #include "util.h"
 
-INIT_SYNCABLE_OBJECT(SyncableObject)
 SyncableObject::SyncableObject(QObject *parent)
     : QObject(parent),
     _initialized(false),
index 3fbf6ec..af52974 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef SYNCABLEOBJECT_H
-#define SYNCABLEOBJECT_H
+#pragma once
 
 #include <QDataStream>
 #include <QMetaType>
 
 #include "signalproxy.h"
 
-#define SYNCABLE_OBJECT static int _classNameOffset__();
-#define INIT_SYNCABLE_OBJECT(x) int x ::_classNameOffset__() {\
-    static int offset = QByteArray(x ::staticMetaObject.className()).length() + 2;\
-    return offset;\
-}\
-
-#ifdef Q_CC_MSVC
-#    define SYNC(...) sync_call__(SignalProxy::Server, (__FUNCTION__ + _classNameOffset__()), __VA_ARGS__);
-#    define REQUEST(...) sync_call__(SignalProxy::Client, (__FUNCTION__ + _classNameOffset__()), __VA_ARGS__);
-#else
-#    define SYNC(...) sync_call__(SignalProxy::Server, __func__, __VA_ARGS__);
-#    define REQUEST(...) sync_call__(SignalProxy::Client, __func__, __VA_ARGS__);
-#endif //Q_CC_MSVC
+/**
+ * This macro needs to be declared in syncable objects, next to the Q_OBJECT macro.
+ *
+ * @note: Specializations of a base syncable object for core/client must not use the macro;
+ *        i.e., if you have Foo, ClientFoo and/or CoreFoo, the SYNCABLE_OBJECT macro would
+ *        only be declared in the class declaration of Foo.
+ */
+#define SYNCABLE_OBJECT \
+    public: \
+        const QMetaObject *syncMetaObject() const final override { \
+            return &staticMetaObject; \
+        } \
+    private: \
+
+#define SYNC(...) sync_call__(SignalProxy::Server, __func__, __VA_ARGS__);
+#define REQUEST(...) sync_call__(SignalProxy::Client, __func__, __VA_ARGS__);
 
 #define SYNC_OTHER(x, ...) sync_call__(SignalProxy::Server, #x, __VA_ARGS__);
 #define REQUEST_OTHER(x, ...) sync_call__(SignalProxy::Client, #x, __VA_ARGS__);
 
 class SyncableObject : public QObject
 {
-    SYNCABLE_OBJECT
     Q_OBJECT
 
 public:
     SyncableObject(QObject *parent = 0);
     SyncableObject(const QString &objectName, QObject *parent = 0);
     SyncableObject(const SyncableObject &other, QObject *parent = 0);
-    ~SyncableObject();
+    ~SyncableObject() override;
 
     //! Stores the object's state into a QVariantMap.
     /** The default implementation takes dynamic properties as well as getters that have
@@ -113,6 +114,3 @@ private:
 
     friend class SignalProxy;
 };
-
-
-#endif
index 4bb89e1..12f85f7 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "transfer.h"
 
-INIT_SYNCABLE_OBJECT(Transfer)
 Transfer::Transfer(const QUuid &uuid, QObject *parent)
     : SyncableObject(parent),
     _status(Status::New),
index 57c9cce..a77676d 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef TRANSFER_H
-#define TRANSFER_H
+#pragma once
 
 #include <QHostAddress>
 #include <QUuid>
@@ -62,7 +61,6 @@ public:
 
     Transfer(const QUuid &uuid, QObject *parent = 0); // for creating a syncable object client-side
     Transfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = 0);
-    inline const QMetaObject *syncMetaObject() const override { return &staticMetaObject; }
 
     QUuid uuid() const;
     Status status() const;
@@ -137,5 +135,3 @@ QDataStream &operator<<(QDataStream &out, Transfer::Status state);
 QDataStream &operator>>(QDataStream &in, Transfer::Status &state);
 QDataStream &operator<<(QDataStream &out, Transfer::Direction direction);
 QDataStream &operator>>(QDataStream &in, Transfer::Direction &direction);
-
-#endif
index 3e8f52d..7df24fe 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "transfer.h"
 
-INIT_SYNCABLE_OBJECT(TransferManager)
-
 TransferManager::TransferManager(QObject *parent)
     : SyncableObject(parent)
 {
index 494d338..94dbbfb 100644 (file)
@@ -39,7 +39,6 @@ public:
     using TransferIdList = QList<QUuid>;
 
     TransferManager(QObject *parent = nullptr);
-    const QMetaObject *syncMetaObject() const override { return &staticMetaObject; }
 
     Transfer *transfer(const QUuid &uuid) const;
     TransferIdList transferIds() const;
index c0475f5..dc6f037 100644 (file)
@@ -24,7 +24,6 @@
 #include "corenetwork.h"
 #include "coresession.h"
 
-INIT_SYNCABLE_OBJECT(CoreAliasManager)
 CoreAliasManager::CoreAliasManager(CoreSession *parent)
     : AliasManager(parent)
 {
index ef49d05..ceeee07 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREALIASMANAGER_H
-#define COREALIASMANAGER_H
+#pragma once
 
 #include "aliasmanager.h"
 
@@ -27,14 +26,11 @@ class CoreSession;
 
 class CoreAliasManager : public AliasManager
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     explicit CoreAliasManager(CoreSession *parent);
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &AliasManager::staticMetaObject; }
-
 protected:
     const Network *network(NetworkId) const;
 
@@ -44,6 +40,3 @@ private slots:
 private:
     void loadDefaults();
 };
-
-
-#endif //COREALIASMANAGER_H
index 73e1805..8a974a1 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <QDebug>
 
-INIT_SYNCABLE_OBJECT(CoreBacklogManager)
 CoreBacklogManager::CoreBacklogManager(CoreSession *coreSession)
     : BacklogManager(coreSession),
     _coreSession(coreSession)
index a86f4c0..801ca78 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREBACKLOGMANAGER_H
-#define COREBACKLOGMANAGER_H
+#pragma once
 
 #include "backlogmanager.h"
 
@@ -27,8 +26,7 @@ class CoreSession;
 
 class CoreBacklogManager : public BacklogManager
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CoreBacklogManager(CoreSession *coreSession = 0);
@@ -46,6 +44,3 @@ public slots:
 private:
     CoreSession *_coreSession;
 };
-
-
-#endif // COREBACKLOGMANAGER_H
index 0548326..de2b521 100644 (file)
@@ -31,8 +31,6 @@ public:
     PurgeEvent() : QEvent(QEvent::User) {}
 };
 
-
-INIT_SYNCABLE_OBJECT(CoreBufferSyncer)
 CoreBufferSyncer::CoreBufferSyncer(CoreSession *parent)
     : BufferSyncer(Core::bufferLastSeenMsgIds(parent->user()), Core::bufferMarkerLineMsgIds(parent->user()), Core::bufferActivities(parent->user()), Core::highlightCounts(parent->user()), parent),
     _coreSession(parent),
index dd33f06..3fba1c7 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREBUFFERSYNCER_H
-#define COREBUFFERSYNCER_H
+#pragma once
 
 #include "buffersyncer.h"
 
@@ -27,8 +26,7 @@ class CoreSession;
 
 class CoreBufferSyncer : public BufferSyncer
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     explicit CoreBufferSyncer(CoreSession *parent);
@@ -89,6 +87,3 @@ private:
 
     void purgeBufferIds();
 };
-
-
-#endif //COREBUFFERSYNCER_H
index b8f441a..c8908d3 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "corebufferviewconfig.h"
 
-INIT_SYNCABLE_OBJECT(CoreBufferViewConfig)
 CoreBufferViewConfig::CoreBufferViewConfig(int bufferViewId, QObject *parent)
     : BufferViewConfig(bufferViewId, parent)
 {
index db10bce..6723951 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#include "bufferviewconfig.h"
+#pragma once
 
-#ifndef COREBUFFERVIEWCONFIG_H
-#define COREBUFFERVIEWCONFIG_H
+#include "bufferviewconfig.h"
 
 class CoreBufferViewConfig : public BufferViewConfig
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CoreBufferViewConfig(int bufferViewId, QObject *parent = 0);
     CoreBufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = 0);
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &BufferViewConfig::staticMetaObject; }
-
 public slots:
     virtual inline void requestSetBufferViewName(const QString &bufferViewName) { setBufferViewName(bufferViewName); }
     virtual inline void requestRemoveBuffer(const BufferId &bufferId) { removeBuffer(bufferId); }
@@ -41,6 +37,3 @@ public slots:
     virtual inline void requestAddBuffer(const BufferId &bufferId, int pos) { addBuffer(bufferId, pos); }
     virtual inline void requestMoveBuffer(const BufferId &bufferId, int pos) { moveBuffer(bufferId, pos); }
 };
-
-
-#endif // COREBUFFERVIEWCONFIG_H
index 87a4192..f1a73db 100644 (file)
@@ -25,7 +25,6 @@
 #include "core.h"
 #include "coresession.h"
 
-INIT_SYNCABLE_OBJECT(CoreBufferViewManager)
 CoreBufferViewManager::CoreBufferViewManager(SignalProxy *proxy, CoreSession *parent)
     : BufferViewManager(proxy, parent),
     _coreSession(parent)
index c6c53e1..782a753 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREBUFFERVIEWMANAGER_H
-#define COREBUFFERVIEWMANAGER_H
+#pragma once
 
 #include "bufferviewmanager.h"
 
@@ -27,14 +26,11 @@ class CoreSession;
 
 class CoreBufferViewManager : public BufferViewManager
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CoreBufferViewManager(SignalProxy *proxy, CoreSession *parent);
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &BufferViewManager::staticMetaObject; }
-
 public slots:
     virtual void requestCreateBufferView(const QVariantMap &properties);
     virtual void requestCreateBufferViews(const QVariantList &properties);
@@ -46,6 +42,3 @@ public slots:
 private:
     CoreSession *_coreSession;
 };
-
-
-#endif // COREBUFFERVIEWMANAGER_H
index b9c81be..ffd3d67 100644 (file)
@@ -25,7 +25,6 @@
 
 constexpr auto settingsKey = "HighlightRuleList";
 
-INIT_SYNCABLE_OBJECT(CoreHighlightRuleManager)
 CoreHighlightRuleManager::CoreHighlightRuleManager(CoreSession *session)
     : HighlightRuleManager(session)
     , _coreSession{session}
index 4cf3427..0648524 100644 (file)
@@ -33,7 +33,6 @@ struct RawMessage;
 class CoreHighlightRuleManager : public HighlightRuleManager
 {
     Q_OBJECT
-    SYNCABLE_OBJECT
 
     using HighlightRuleManager::match;
 
@@ -45,8 +44,6 @@ public:
      */
     explicit CoreHighlightRuleManager(CoreSession *session);
 
-    virtual const QMetaObject *syncMetaObject() const override { return &HighlightRuleManager::staticMetaObject; }
-
     bool match(const RawMessage &msg, const QString &currentNick, const QStringList &identityNicks);
 
 public slots:
index 840edbd..5d2bb2e 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "signalproxy.h"
 
-INIT_SYNCABLE_OBJECT(CoreIdentity)
 CoreIdentity::CoreIdentity(IdentityId id, QObject *parent)
     : Identity(id, parent)
 #ifdef HAVE_SSL
@@ -108,7 +107,7 @@ CoreIdentity &CoreIdentity::operator=(const CoreIdentity &identity)
 // ========================================
 //  CoreCertManager
 // ========================================
-INIT_SYNCABLE_OBJECT(CoreCertManager)
+
 CoreCertManager::CoreCertManager(CoreIdentity &identity)
     : CertManager(identity.id()),
     identity(identity)
index 513bdea..698cd4c 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREIDENTITY_H
-#define COREIDENTITY_H
+#pragma once
 
 #include "identity.h"
 
@@ -37,8 +36,7 @@ class SignalProxy;
 class CoreIdentity;
 class CoreCertManager : public CertManager
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CoreCertManager(CoreIdentity &identity);
@@ -66,8 +64,7 @@ private:
 // =========================================
 class CoreIdentity : public Identity
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CoreIdentity(IdentityId id, QObject *parent = 0);
@@ -109,7 +106,4 @@ inline const QSslCertificate &CoreCertManager::sslCert() const
     return identity.sslCert();
 }
 
-
 #endif
-
-#endif //COREIDENTITY_H
index 3b38ea4..c6c3a7a 100644 (file)
@@ -23,7 +23,6 @@
 #include "core.h"
 #include "coresession.h"
 
-INIT_SYNCABLE_OBJECT(CoreIgnoreListManager)
 CoreIgnoreListManager::CoreIgnoreListManager(CoreSession *parent)
     : IgnoreListManager(parent)
 {
index f7b09bc..5469574 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREIGNORELISTMANAGER_H
-#define COREIGNORELISTMANAGER_H
+#pragma once
 
 #include "ignorelistmanager.h"
 
@@ -28,14 +27,11 @@ struct RawMessage;
 
 class CoreIgnoreListManager : public IgnoreListManager
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     explicit CoreIgnoreListManager(CoreSession *parent);
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &IgnoreListManager::staticMetaObject; }
-
     StrictnessType match(const RawMessage &rawMsg, const QString &networkName);
 
 public slots:
@@ -54,6 +50,3 @@ private slots:
 //private:
 //  void loadDefaults();
 };
-
-
-#endif //COREIGNORELISTMANAGER_H
index b819a69..e6a48c9 100644 (file)
@@ -21,7 +21,6 @@
 #include "coreircchannel.h"
 #include "corenetwork.h"
 
-INIT_SYNCABLE_OBJECT(CoreIrcChannel)
 CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network)
     : IrcChannel(channelname, network),
     _receivedWelcomeMsg(false)
index ac2af5a..249aca0 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREIRCCHANNEL_H
-#define COREIRCCHANNEL_H
+#pragma once
 
 #include "ircchannel.h"
 
 
 class CoreIrcChannel : public IrcChannel
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CoreIrcChannel(const QString &channelname, Network *network);
     virtual ~CoreIrcChannel();
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &IrcChannel::staticMetaObject; }
-
 #ifdef HAVE_QCA2
     Cipher *cipher() const;
     void setEncrypted(bool);
@@ -53,6 +49,3 @@ private:
     mutable Cipher *_cipher;
 #endif
 };
-
-
-#endif //COREIRCCHANNEL_H
index 1c4bfde..9ff68fa 100644 (file)
@@ -25,7 +25,6 @@
 
 constexpr auto kTimeoutMs = 5000;
 
-INIT_SYNCABLE_OBJECT(CoreIrcListHelper)
 QVariantList CoreIrcListHelper::requestChannelList(const NetworkId &netId, const QStringList &channelFilters)
 {
     if (_finishedChannelLists.contains(netId))
index 8f1081c..637b367 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREIRCLISTHELPER_H
-#define COREIRCLISTHELPER_H
+#pragma once
 
 #include <memory>
 
@@ -32,14 +31,11 @@ class QTimerEvent;
 
 class CoreIrcListHelper : public IrcListHelper
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     inline CoreIrcListHelper(CoreSession *coreSession) : IrcListHelper(coreSession), _coreSession(coreSession) {};
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &IrcListHelper::staticMetaObject; }
-
     inline CoreSession *coreSession() const { return _coreSession; }
 
     inline bool requestInProgress(const NetworkId &netId) const { return _channelLists.contains(netId); }
@@ -64,6 +60,3 @@ private:
     QHash<int, NetworkId> _queryTimeoutByTimerId;
     QHash<NetworkId, std::shared_ptr<QBasicTimer>> _queryTimeoutByNetId;
 };
-
-
-#endif //COREIRCLISTHELPER_H
index 2d24101..e0806d3 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREIRCUSER_H_
-#define COREIRCUSER_H_
+#pragma once
 
 #include "ircuser.h"
 
 
 class CoreIrcUser : public IrcUser
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CoreIrcUser(const QString &hostmask, Network *network);
     virtual ~CoreIrcUser();
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &IrcUser::staticMetaObject; }
-
 #ifdef HAVE_QCA2
     Cipher *cipher() const;
 #endif
@@ -47,6 +43,3 @@ private:
     mutable Cipher *_cipher;
 #endif
 };
-
-
-#endif
index 2b8f131..4b32f2c 100644 (file)
@@ -33,7 +33,6 @@
 // IRCv3 capabilities
 #include "irccap.h"
 
-INIT_SYNCABLE_OBJECT(CoreNetwork)
 CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session)
     : Network(networkid, session),
     _coreSession(session),
index 99e5fc2..4082268 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CORENETWORK_H
-#define CORENETWORK_H
+#pragma once
 
 #include "network.h"
 #include "coreircchannel.h"
@@ -52,14 +51,12 @@ class Event;
 
 class CoreNetwork : public Network
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CoreNetwork(const NetworkId &networkid, CoreSession *session);
     virtual ~CoreNetwork();
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &Network::staticMetaObject; }
 
     inline CoreIdentity *identityPtr() const { return coreSession()->identity(identity()); }
     inline CoreSession *coreSession() const { return _coreSession; }
@@ -601,6 +598,3 @@ private:
     // List of blowfish keys for channels
     QHash<QString, QByteArray> _cipherKeys;
 };
-
-
-#endif //CORENETWORK_H
index 5f5e2b6..3ae0ae0 100644 (file)
@@ -22,7 +22,6 @@
 #include "coresession.h"
 #include "corenetworkconfig.h"
 
-INIT_SYNCABLE_OBJECT(CoreNetworkConfig)
 CoreNetworkConfig::CoreNetworkConfig(const QString &objectName, CoreSession *session)
     : NetworkConfig(objectName, session)
 {
index 8d75829..4b08a58 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CORENETWORKCONFIG_H_
-#define CORENETWORKCONFIG_H_
+#pragma once
 
 #include "networkconfig.h"
 
@@ -27,14 +26,11 @@ class CoreSession;
 
 class CoreNetworkConfig : public NetworkConfig
 {
-    SYNCABLE_OBJECT
-        Q_OBJECT
+    Q_OBJECT
 
 public:
     CoreNetworkConfig(const QString &objectName, CoreSession *parent);
 
-    inline virtual const QMetaObject *syncMetaObject() const { return &NetworkConfig::staticMetaObject; }
-
     void save();
 
 public slots:
@@ -47,6 +43,3 @@ public slots:
     virtual inline void requestSetAutoWhoDelay(int delay) { setAutoWhoDelay(delay); }
     virtual inline void requestSetStandardCtcp(bool enabled) { setStandardCtcp(enabled); }
 };
-
-
-#endif
index 1b03b45..34443a0 100644 (file)
@@ -27,8 +27,6 @@
 
 const qint64 chunkSize = 16 * 1024;
 
-INIT_SYNCABLE_OBJECT(CoreTransfer)
-
 CoreTransfer::CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 fileSize, QObject *parent)
     : Transfer(direction, nick, fileName, address, port, fileSize, parent),
     _socket(0),
index 7ff943c..25e8ef9 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CORETRANSFER_H
-#define CORETRANSFER_H
+#pragma once
 
 #include <QPointer>
 
@@ -31,7 +30,6 @@ class QTcpSocket;
 class CoreTransfer : public Transfer
 {
     Q_OBJECT
-    SYNCABLE_OBJECT
 
 public:
     CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = 0);
@@ -62,5 +60,3 @@ private:
     QByteArray _buffer;
     bool _reading;
 };
-
-#endif
index b656bac..42db232 100644 (file)
@@ -19,5 +19,3 @@
  ***************************************************************************/
 
 #include "coretransfermanager.h"
-
-INIT_SYNCABLE_OBJECT(CoreTransferManager)
index 6b2b152..ceb572d 100644 (file)
@@ -27,7 +27,6 @@ class CoreTransfer;
 class CoreTransferManager : public TransferManager
 {
     Q_OBJECT
-    SYNCABLE_OBJECT
 
 public:
     using TransferManager::TransferManager;