Decomplexify & reencapsulate
[quassel.git] / src / common / syncableobject.cpp
index b8c8d5b..e6d88a3 100644 (file)
@@ -50,10 +50,11 @@ SyncableObject::SyncableObject(const SyncableObject &other, QObject *parent)
 }
 
 SyncableObject::~SyncableObject() {
-  QList<SignalProxy *> proxies = _signalProxies;
-  _signalProxies.clear();
-  for(int i = 0; i < proxies.count(); i++) {
-    proxies[i]->stopSynchronize(this);
+  QList<SignalProxy *>::iterator proxyIter = _signalProxies.begin();
+  while(proxyIter != _signalProxies.end()) {
+    SignalProxy *proxy = (*proxyIter);
+    proxyIter = _signalProxies.erase(proxyIter);
+    proxy->stopSynchronize(this);
   }
 }
 
@@ -156,14 +157,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 {