common: Simplify SyncableObject macros and usage
[quassel.git] / src / common / syncableobject.cpp
index b4f395f..9394659 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -27,7 +27,6 @@
 #include "signalproxy.h"
 #include "util.h"
 
-INIT_SYNCABLE_OBJECT(SyncableObject)
 SyncableObject::SyncableObject(QObject *parent)
     : QObject(parent),
     _initialized(false),
@@ -114,11 +113,7 @@ QVariantMap SyncableObject::toVariantMap()
 
         QVariant::Type variantType = QVariant::nameToType(method.typeName());
         if (variantType == QVariant::Invalid && !QByteArray(method.typeName()).isEmpty()) {
-#if QT_VERSION >= 0x050000
             qWarning() << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.methodSignature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName());
-#else
-            qWarning() << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.signature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName());
-#endif
             continue;
         }
 
@@ -141,7 +136,7 @@ void SyncableObject::fromVariantMap(const QVariantMap &properties)
     while (iterator != properties.constEnd()) {
         propName = iterator.key();
         if (propName == "objectName") {
-            iterator++;
+            ++iterator;
             continue;
         }
 
@@ -152,7 +147,7 @@ void SyncableObject::fromVariantMap(const QVariantMap &properties)
         else
             setProperty(propName.toLatin1(), iterator.value());
         // qDebug() << "<<< SYNC:" << name << iterator.value();
-        iterator++;
+        ++iterator;
     }
 }