fixing bulk updates of SyncObjects
authorMarcus Eggenberger <egs@quassel-irc.org>
Mon, 24 Aug 2009 19:50:54 +0000 (21:50 +0200)
committerMarcus Eggenberger <egs@quassel-irc.org>
Mon, 24 Aug 2009 19:54:07 +0000 (21:54 +0200)
src/client/clientidentity.cpp
src/common/bufferviewconfig.cpp
src/common/signalproxy.cpp
src/common/syncableobject.cpp
src/common/syncableobject.h
src/core/coreidentity.cpp
src/core/coresession.cpp
src/qtui/settingspages/aliasesmodel.cpp

index 4849bdb..af3541c 100644 (file)
@@ -61,7 +61,7 @@ void CertIdentity::enableEditSsl(bool enable) {
   _certManager = new ClientCertManager(id(), this);
   if(isValid()) { // this means we are not a newly created Identity but have a proper Id
     Client::signalProxy()->synchronize(_certManager);
-    connect(_certManager, SIGNAL(updated(const QVariantMap &)), this, SLOT(markClean()));
+    connect(_certManager, SIGNAL(updated()), this, SLOT(markClean()));
     connect(_certManager, SIGNAL(initDone()), this, SLOT(markClean()));
   }
 }
index 14e4d04..5cae5f8 100644 (file)
@@ -198,6 +198,7 @@ void BufferViewConfig::addBuffer(const BufferId &bufferId, int pos) {
     _temporarilyRemovedBuffers.remove(bufferId);
 
   _buffers.insert(pos, bufferId);
+  SYNC(ARG(bufferId), ARG(pos))
   emit bufferAdded(bufferId, pos);
   emit configChanged();
 }
@@ -212,6 +213,7 @@ void BufferViewConfig::moveBuffer(const BufferId &bufferId, int pos) {
     pos = _buffers.count() - 1;
 
   _buffers.move(_buffers.indexOf(bufferId), pos);
+  SYNC(ARG(bufferId), ARG(pos))
   emit bufferMoved(bufferId, pos);
   emit configChanged();
 }
@@ -224,7 +226,7 @@ void BufferViewConfig::removeBuffer(const BufferId &bufferId) {
     _removedBuffers.remove(bufferId);
 
   _temporarilyRemovedBuffers << bufferId;
-
+  SYNC(ARG(bufferId))
   emit bufferRemoved(bufferId);
   emit configChanged();
 }
@@ -238,6 +240,7 @@ void BufferViewConfig::removeBufferPermanently(const BufferId &bufferId) {
 
   _removedBuffers << bufferId;
 
+  SYNC(ARG(bufferId))
   emit bufferPermanentlyRemoved(bufferId);
   emit configChanged();
 }
index ebcf507..756e63c 100644 (file)
@@ -1172,7 +1172,6 @@ const QHash<int, int> &SignalProxy::ExtendedMetaObject::receiveMap() {
 
       if(receiverId != -1) {
        receiveMap[i] = receiverId;
-        qDebug() << requestSlot.signature() << _meta->method(receiverId).signature() << "---" << i << receiverId;
       }
     }
     _receiveMap = receiveMap;
index 325f0be..e6d88a3 100644 (file)
@@ -157,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 {
index d0d7a8b..01fb395 100644 (file)
@@ -76,8 +76,7 @@ protected:
 signals:
   void initDone();
   void updatedRemotely();
-  void updated(const QVariantMap &properties);
-  void updateRequested(const QVariantMap &properties);
+  void updated();
 
 private:
   void synchronize(SignalProxy *proxy);
index fb836e1..fef7522 100644 (file)
@@ -31,7 +31,7 @@ CoreIdentity::CoreIdentity(IdentityId id, QObject *parent)
 {
 #ifdef HAVE_SSL
   connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
-  connect(&_certManager, SIGNAL(updated(const QVariantMap &)), this, SIGNAL(updated(const QVariantMap &)));
+  connect(&_certManager, SIGNAL(updated()), this, SIGNAL(updated()));
 #endif
 }
 
@@ -43,7 +43,7 @@ CoreIdentity::CoreIdentity(const Identity &other, QObject *parent)
 {
 #ifdef HAVE_SSL
   connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
-  connect(&_certManager, SIGNAL(updated(const QVariantMap &)), this, SIGNAL(updated(const QVariantMap &)));
+  connect(&_certManager, SIGNAL(updated()), this, SIGNAL(updated()));
 #endif
 }
 
@@ -57,7 +57,7 @@ CoreIdentity::CoreIdentity(const CoreIdentity &other, QObject *parent)
 {
 #ifdef HAVE_SSL
   connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
-  connect(&_certManager, SIGNAL(updated(const QVariantMap &)), this, SIGNAL(updated(const QVariantMap &)));
+  connect(&_certManager, SIGNAL(updated()), this, SIGNAL(updated()));
 #endif
 }
 
index 0c62171..33f5b09 100644 (file)
@@ -337,7 +337,7 @@ void CoreSession::createIdentity(const CoreIdentity &identity) {
   _identities[identity.id()] = coreIdentity;
   // CoreIdentity has it's own synchronize method since it's "private" sslManager needs to be synced aswell
   coreIdentity->synchronize(signalProxy());
-  connect(coreIdentity, SIGNAL(updated(const QVariantMap &)), this, SLOT(updateIdentityBySender()));
+  connect(coreIdentity, SIGNAL(updated()), this, SLOT(updateIdentityBySender()));
   emit identityCreated(*coreIdentity);
 }
 
index 416414d..c36bebd 100644 (file)
@@ -232,7 +232,7 @@ void AliasesModel::initDone() {
 }
 
 void AliasesModel::clientConnected() {
-  connect(Client::aliasManager(), SIGNAL(updated(QVariantMap)), SLOT(revert()));
+  connect(Client::aliasManager(), SIGNAL(updated()), SLOT(revert()));
   if(Client::aliasManager()->isInitialized())
     initDone();
   else