X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsyncableobject.cpp;h=b66626d66d1e2da0955f29c3b07aa6e3a06dc4f8;hp=b8c8d5ba492474e600079c927913431e7f838356;hb=62b7bed21f011037a34d7a4ea797d79fbdeff687;hpb=27de4d2719454c4deb5f6e24b82bdd8991e45260 diff --git a/src/common/syncableobject.cpp b/src/common/syncableobject.cpp index b8c8d5ba..b66626d6 100644 --- a/src/common/syncableobject.cpp +++ b/src/common/syncableobject.cpp @@ -27,6 +27,7 @@ #include "signalproxy.h" #include "util.h" +INIT_SYNCABLE_OBJECT(SyncableObject) SyncableObject::SyncableObject(QObject *parent) : QObject(parent), _initialized(false), @@ -50,10 +51,11 @@ SyncableObject::SyncableObject(const SyncableObject &other, QObject *parent) } SyncableObject::~SyncableObject() { - QList proxies = _signalProxies; - _signalProxies.clear(); - for(int i = 0; i < proxies.count(); i++) { - proxies[i]->stopSynchronize(this); + QList::iterator proxyIter = _signalProxies.begin(); + while(proxyIter != _signalProxies.end()) { + SignalProxy *proxy = (*proxyIter); + proxyIter = _signalProxies.erase(proxyIter); + proxy->stopSynchronize(this); } } @@ -156,14 +158,15 @@ void SyncableObject::renameObject(const QString &newName) { void SyncableObject::update(const QVariantMap &properties) { fromVariantMap(properties); - emit updated(properties); + SYNC(ARG(properties)) + emit updated(); } void SyncableObject::requestUpdate(const QVariantMap &properties) { if(allowClientUpdates()) { update(properties); } - emit updateRequested(properties); + REQUEST(ARG(properties)) } void SyncableObject::sync_call__(SignalProxy::ProxyMode modeType, const char *funcname, ...) const {