Workaround #151 (deleting and readding a network with the same name)
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 26 Jun 2008 23:27:04 +0000 (01:27 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 26 Jun 2008 23:27:04 +0000 (01:27 +0200)
Real reason lies in the storage engine and still needs to be fixed;
however, the problem described in #151 is solved with this workaround.

src/qtui/settingspages/networkssettingspage.cpp

index 15afeff..7c06ed4 100644 (file)
@@ -696,6 +696,9 @@ SaveNetworksDlg::SaveNetworksDlg(const QList<NetworkInfo> &toCreate, const QList
     connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(clientEvent()));
     connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), this, SLOT(clientEvent()));
 
     connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(clientEvent()));
     connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), this, SLOT(clientEvent()));
 
+    foreach(NetworkId id, toRemove) {
+      Client::removeNetwork(id);
+    }
     foreach(NetworkInfo info, toCreate) {
       Client::createNetwork(info);
     }
     foreach(NetworkInfo info, toCreate) {
       Client::createNetwork(info);
     }
@@ -710,9 +713,6 @@ SaveNetworksDlg::SaveNetworksDlg(const QList<NetworkInfo> &toCreate, const QList
       connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientEvent()));
       Client::updateNetwork(info);
     }
       connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientEvent()));
       Client::updateNetwork(info);
     }
-    foreach(NetworkId id, toRemove) {
-      Client::removeNetwork(id);
-    }
   } else {
     qWarning() << "Sync dialog called without stuff to change!";
     accept();
   } else {
     qWarning() << "Sync dialog called without stuff to change!";
     accept();