From: Marcus Eggenberger Date: Mon, 24 Aug 2009 19:50:54 +0000 (+0200) Subject: fixing bulk updates of SyncObjects X-Git-Tag: 0.5-rc1~32 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=39eb2fda3eaef2de78a8134556015ff86e9b85d4 fixing bulk updates of SyncObjects --- diff --git a/src/client/clientidentity.cpp b/src/client/clientidentity.cpp index 4849bdbd..af3541cf 100644 --- a/src/client/clientidentity.cpp +++ b/src/client/clientidentity.cpp @@ -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())); } } diff --git a/src/common/bufferviewconfig.cpp b/src/common/bufferviewconfig.cpp index 14e4d044..5cae5f8f 100644 --- a/src/common/bufferviewconfig.cpp +++ b/src/common/bufferviewconfig.cpp @@ -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(); } diff --git a/src/common/signalproxy.cpp b/src/common/signalproxy.cpp index ebcf5076..756e63c3 100644 --- a/src/common/signalproxy.cpp +++ b/src/common/signalproxy.cpp @@ -1172,7 +1172,6 @@ const QHash &SignalProxy::ExtendedMetaObject::receiveMap() { if(receiverId != -1) { receiveMap[i] = receiverId; - qDebug() << requestSlot.signature() << _meta->method(receiverId).signature() << "---" << i << receiverId; } } _receiveMap = receiveMap; diff --git a/src/common/syncableobject.cpp b/src/common/syncableobject.cpp index 325f0be3..e6d88a3a 100644 --- a/src/common/syncableobject.cpp +++ b/src/common/syncableobject.cpp @@ -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 { diff --git a/src/common/syncableobject.h b/src/common/syncableobject.h index d0d7a8b4..01fb3953 100644 --- a/src/common/syncableobject.h +++ b/src/common/syncableobject.h @@ -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); diff --git a/src/core/coreidentity.cpp b/src/core/coreidentity.cpp index fb836e11..fef75222 100644 --- a/src/core/coreidentity.cpp +++ b/src/core/coreidentity.cpp @@ -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 } diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 0c621718..33f5b09d 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -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); } diff --git a/src/qtui/settingspages/aliasesmodel.cpp b/src/qtui/settingspages/aliasesmodel.cpp index 416414d5..c36bebdd 100644 --- a/src/qtui/settingspages/aliasesmodel.cpp +++ b/src/qtui/settingspages/aliasesmodel.cpp @@ -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