Skip to content

Commit

Permalink
Fixed a hangup after connecting to server
Browse files Browse the repository at this point in the history
  • Loading branch information
lukitree committed Aug 6, 2015
1 parent 8d91a68 commit 764e74d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions Server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down Expand Up @@ -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:
Expand Down
9 changes: 6 additions & 3 deletions Server/server.ui
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<rect>
<x>10</x>
<y>10</y>
<width>351</width>
<width>331</width>
<height>281</height>
</rect>
</property>
Expand All @@ -39,12 +39,15 @@
<widget class="QListWidget" name="userList">
<property name="geometry">
<rect>
<x>370</x>
<x>350</x>
<y>30</y>
<width>71</width>
<width>91</width>
<height>261</height>
</rect>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
</widget>
</widget>
</widget>
Expand Down

0 comments on commit 764e74d

Please sign in to comment.