- Q_ASSERT(!_networks.contains(id));
-
- Network *net = new Network(id, this);
- connect(net, SIGNAL(connectRequested(NetworkId)), this, SLOT(connectToNetwork(NetworkId)));
- connect(net, SIGNAL(disconnectRequested(NetworkId)), this, SLOT(disconnectFromNetwork(NetworkId)));
- net->setNetworkInfo(info);
- net->setProxy(signalProxy());
- _networks[id] = net;
- signalProxy()->synchronize(net);
- emit networkCreated(id);
+ if(!_networks.contains(id)) {
+ Network *net = new Network(id, this);
+ connect(net, SIGNAL(connectRequested(NetworkId)), this, SLOT(connectToNetwork(NetworkId)));
+ connect(net, SIGNAL(disconnectRequested(NetworkId)), this, SLOT(disconnectFromNetwork(NetworkId)));
+ net->setNetworkInfo(info);
+ net->setProxy(signalProxy());
+ _networks[id] = net;
+ signalProxy()->synchronize(net);
+ emit networkCreated(id);
+ } else {
+ qWarning() << qPrintable(tr("CoreSession::createNetwork(): Trying to create a network that already exists, updating instead!"));
+ updateNetwork(info);
+ }