X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclient.cpp;h=a2ffd8e9c90d0260871b7dae8ea1c848b8037044;hp=48c471c5a07f7aed91c16ec02f9bb4f88f37477f;hb=c2718511214289f58a02207f7988876c420e8c7e;hpb=6e50e532fa24b8e36237eb7ae9c5c9b21058519f diff --git a/src/client/client.cpp b/src/client/client.cpp index 48c471c5..a2ffd8e9 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -110,13 +110,11 @@ void Client::init() { p->attachSignal(this, SIGNAL(requestNetworkStates())); p->attachSignal(this, SIGNAL(requestCreateIdentity(const Identity &)), SIGNAL(createIdentity(const Identity &))); - p->attachSignal(this, SIGNAL(requestUpdateIdentity(const Identity &)), SIGNAL(updateIdentity(const Identity &))); p->attachSignal(this, SIGNAL(requestRemoveIdentity(IdentityId)), SIGNAL(removeIdentity(IdentityId))); p->attachSlot(SIGNAL(identityCreated(const Identity &)), this, SLOT(coreIdentityCreated(const Identity &))); p->attachSlot(SIGNAL(identityRemoved(IdentityId)), this, SLOT(coreIdentityRemoved(IdentityId))); p->attachSignal(this, SIGNAL(requestCreateNetwork(const NetworkInfo &)), SIGNAL(createNetwork(const NetworkInfo &))); - p->attachSignal(this, SIGNAL(requestUpdateNetwork(const NetworkInfo &)), SIGNAL(updateNetwork(const NetworkInfo &))); p->attachSignal(this, SIGNAL(requestRemoveNetwork(NetworkId)), SIGNAL(removeNetwork(NetworkId))); p->attachSlot(SIGNAL(networkCreated(NetworkId)), this, SLOT(coreNetworkCreated(NetworkId))); p->attachSlot(SIGNAL(networkRemoved(NetworkId)), this, SLOT(coreNetworkRemoved(NetworkId))); @@ -208,14 +206,19 @@ void Client::createNetwork(const NetworkInfo &info) { emit instance()->requestCreateNetwork(info); } -void Client::updateNetwork(const NetworkInfo &info) { - emit instance()->requestUpdateNetwork(info); -} - void Client::removeNetwork(NetworkId id) { emit instance()->requestRemoveNetwork(id); } +void Client::updateNetwork(const NetworkInfo &info) { + Network *netptr = instance()->_networks.value(info.networkId, 0); + if(!netptr) { + qWarning() << "Update for unknown network requested:" << info; + return; + } + netptr->requestSetNetworkInfo(info); +} + void Client::addNetwork(Network *net) { net->setProxy(signalProxy()); signalProxy()->synchronize(net); @@ -257,8 +260,13 @@ void Client::createIdentity(const Identity &id) { emit instance()->requestCreateIdentity(id); } -void Client::updateIdentity(const Identity &id) { - emit instance()->requestUpdateIdentity(id); +void Client::updateIdentity(IdentityId id, const QVariantMap &ser) { + Identity *idptr = instance()->_identities.value(id, 0); + if(!idptr) { + qWarning() << "Update for unknown identity requested:" << id; + return; + } + idptr->requestUpdate(ser); } void Client::removeIdentity(IdentityId id) {