Workaround queued signals problem in netclient instead. Should fix everything.
authorunc0rr
Thu, 21 Feb 2013 22:20:43 +0400
changeset 8534 92da587691c9
parent 8531 5e7f01d78ab0
child 8539 49e657b77499
Workaround queued signals problem in netclient instead. Should fix everything.
QTfrontend/hwform.cpp
QTfrontend/net/newnetclient.cpp
QTfrontend/net/newnetclient.h
QTfrontend/ui/widget/themeprompt.cpp
--- a/QTfrontend/hwform.cpp	Thu Feb 21 01:37:04 2013 +0400
+++ b/QTfrontend/hwform.cpp	Thu Feb 21 22:20:43 2013 +0400
@@ -1202,7 +1202,7 @@
     connect(hwnet, SIGNAL(LeftRoom(const QString&)), this, SLOT(NetLeftRoom(const QString&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(RemoveNetTeam(const HWTeam&)), this, SLOT(RemoveNetTeam(const HWTeam&)), Qt::QueuedConnection);
-    connect(hwnet, SIGNAL(TeamAccepted(const QString&)), this, SLOT(NetTeamAccepted(const QString&)));
+    connect(hwnet, SIGNAL(TeamAccepted(const QString&)), this, SLOT(NetTeamAccepted(const QString&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(NickRegistered(const QString&)), this, SLOT(NetNickRegistered(const QString&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(NickNotRegistered(const QString&)), this, SLOT(NetNickNotRegistered(const QString&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(NickTaken(const QString&)), this, SLOT(NetNickTaken(const QString&)), Qt::QueuedConnection);
@@ -1234,13 +1234,12 @@
             hwnet, SLOT(askRoomsList()));
 
 // room status stuff
-// not queued because creates new signal/slot connection
     connect(hwnet, SIGNAL(roomMaster(bool)),
-            this, SLOT(NetGameChangeStatus(bool)));
+            this, SLOT(NetGameChangeStatus(bool)), Qt::QueuedConnection);
 
 // net page stuff
     connect(hwnet, SIGNAL(roomNameUpdated(const QString &)),
-            ui.pageNetGame, SLOT(setRoomName(const QString &)));
+            ui.pageNetGame, SLOT(setRoomName(const QString &)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(chatStringFromNet(const QString&)),
             ui.pageNetGame->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
 
--- a/QTfrontend/net/newnetclient.cpp	Thu Feb 21 01:37:04 2013 +0400
+++ b/QTfrontend/net/newnetclient.cpp	Thu Feb 21 22:20:43 2013 +0400
@@ -63,6 +63,8 @@
     connect(&NetSocket, SIGNAL(disconnected()), this, SLOT(OnDisconnect()));
     connect(&NetSocket, SIGNAL(error(QAbstractSocket::SocketError)), this,
             SLOT(displayError(QAbstractSocket::SocketError)));
+
+    connect(this, SIGNAL(messageProcessed()), this, SLOT(ClientRead()), Qt::QueuedConnection);
 }
 
 HWNewNet::~HWNewNet()
@@ -186,6 +188,8 @@
         {
             ParseCmd(cmdbuf);
             cmdbuf.clear();
+            emit messageProcessed();
+            return ;
         }
         else
             cmdbuf << s;
--- a/QTfrontend/net/newnetclient.h	Thu Feb 21 01:37:04 2013 +0400
+++ b/QTfrontend/net/newnetclient.h	Thu Feb 21 22:20:43 2013 +0400
@@ -131,6 +131,8 @@
 
         void setMyReadyStatus(bool isReady);
 
+        void messageProcessed();
+
     public slots:
         void ToggleReady();
         void chatLineToNet(const QString& str);
--- a/QTfrontend/ui/widget/themeprompt.cpp	Thu Feb 21 01:37:04 2013 +0400
+++ b/QTfrontend/ui/widget/themeprompt.cpp	Thu Feb 21 22:20:43 2013 +0400
@@ -162,4 +162,4 @@
 {
     filterModel->setFilterFixedString(text);
     list->setCurrentIndex(filterModel->index(0, 0));
-}
\ No newline at end of file
+}