X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsyncableobject.cpp;h=ec34708a53980785efb57c1c4472495714bbf8d4;hp=426bc86cf28dd3d8f122a7e85285c6af44c5e87c;hb=0324c701d9cc8c656e6188b4e102e19e05c98201;hpb=997a62b68d7469a93f373476dd955c44eb051be0 diff --git a/src/common/syncableobject.cpp b/src/common/syncableobject.cpp index 426bc86c..ec34708a 100644 --- a/src/common/syncableobject.cpp +++ b/src/common/syncableobject.cpp @@ -34,13 +34,30 @@ SyncableObject::SyncableObject(QObject *parent) { } +SyncableObject::SyncableObject(const QString &objectName, QObject *parent) + : QObject(parent), + _initialized(false), + _allowClientUpdates(false) +{ + setObjectName(objectName); +} + SyncableObject::SyncableObject(const SyncableObject &other, QObject *parent) : QObject(parent), _initialized(other._initialized), - _allowClientUpdates(false) + _allowClientUpdates(other._allowClientUpdates) { } +SyncableObject &SyncableObject::operator=(const SyncableObject &other) { + if(this == &other) + return *this; + + _initialized = other._initialized; + _allowClientUpdates = other._allowClientUpdates; + return *this; +} + bool SyncableObject::isInitialized() const { return _initialized; } @@ -83,7 +100,6 @@ QVariantMap SyncableObject::toVariantMap() { QMetaObject::invokeMethod(this, methodname.toAscii(), genericvalue); properties[SignalProxy::methodBaseName(method)] = value; - // qDebug() << ">>> SYNC:" << methodBaseName(method) << value; } // properties["Payload"] = QByteArray(10000000, 'a'); // for testing purposes return properties; @@ -101,7 +117,7 @@ void SyncableObject::fromVariantMap(const QVariantMap &properties) { iterator++; continue; } - + int propertyIndex = meta->indexOfProperty(propName.toAscii()); if(propertyIndex == -1 || !meta->property(propertyIndex).isWritable())