From 764e74dfde7949b0cf67f31efb7e066e7fc21630 Mon Sep 17 00:00:00 2001 From: lukitree Date: Thu, 6 Aug 2015 16:22:04 -0600 Subject: [PATCH] Fixed a hangup after connecting to server --- Client/client.cpp | 2 +- Server/server.cpp | 4 +--- Server/server.ui | 9 ++++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Client/client.cpp b/Client/client.cpp index 1048b40..dd37612 100644 --- a/Client/client.cpp +++ b/Client/client.cpp @@ -158,7 +158,7 @@ void Client::sendCredentials() void Client::onDisconnect() { - new QListWidgetItem("Disconnected.", ui.messageList); + new QListWidgetItem("-> Disconnected.", ui.messageList); ui.messageList->scrollToBottom(); ui.userList->clear(); credentialsSent = false; diff --git a/Server/server.cpp b/Server/server.cpp index 5b3d7c8..ba4cf45 100644 --- a/Server/server.cpp +++ b/Server/server.cpp @@ -19,7 +19,7 @@ Server::Server(QWidget *parent) QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SIGNAL(SEND_UserList())); - timer->start(1000000); + timer->start(6000); connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); connect(this, SIGNAL(newConnection()), this, SLOT(getMessage())); @@ -175,8 +175,6 @@ void Server::getMessage() userList.insert(std::make_pair(ID, username)); new QListWidgetItem(username, ui.userList); ui.userList->scrollToBottom(); - - emit SEND_UserList(); break; } default: diff --git a/Server/server.ui b/Server/server.ui index 1ad6e12..8ca4c22 100644 --- a/Server/server.ui +++ b/Server/server.ui @@ -19,7 +19,7 @@ 10 10 - 351 + 331 281 @@ -39,12 +39,15 @@ - 370 + 350 30 - 71 + 91 261 + + true +