[prev in list] [next in list] [prev in thread] [next in thread]
List: atlantik-devel
Subject: [atlantik-cvs] CVS: kdegames/atlantik/libatlantikclient atlantik_network.cpp,1.42.2.4,1.42.2.5
From: kde () office ! kde ! org
Date: 2002-07-14 11:01:08
[Download RAW message or body]
Update of /home/kde/kdegames/atlantik/libatlantikclient
In directory office:/tmp/cvs-serv15687/libatlantikclient
Modified Files:
Tag: ATLANTIK_0_3_BRANCH
atlantik_network.cpp
Log Message:
more gui updates during network traffic
Index: atlantik_network.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikclient/atlantik_network.cpp,v
retrieving revision 1.42.2.4
retrieving revision 1.42.2.5
diff -u -d -r1.42.2.4 -r1.42.2.5
--- atlantik_network.cpp 2002/07/11 17:52:43 1.42.2.4
+++ atlantik_network.cpp 2002/07/14 11:01:06 1.42.2.5
@@ -16,6 +16,8 @@
#include <iostream>
+#include <qtimer.h>
+
#include <kdebug.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -204,18 +206,23 @@
void AtlantikNetwork::slotRead()
{
- char *tmp = new char[1024 * 32];
- while(canReadLine())
+ if (canReadLine())
{
+ char *tmp = new char[1024 * 32];
readLine(tmp, 1024 * 32);
processMsg(tmp);
- }
- delete[] tmp;
+ delete[] tmp;
- // Maximum message size. Messages won't get bigger than 32k anyway, so
- // if we didn't receive a newline by now, we probably won't anyway.
- if (bytesAvailable() > (1024 * 32))
- flush();
+ // There might be more data
+ QTimer::singleShot(0, this, SLOT(slotRead()));
+ }
+ else
+ {
+ // Maximum message size. Messages won't get bigger than 32k anyway, so
+ // if we didn't receive a newline by now, we probably won't anyway.
+ if (bytesAvailable() > (1024 * 32))
+ flush();
+ }
}
void AtlantikNetwork::processMsg(QString str)
_______________________________________________
atlantik-cvs mailing list
atlantik-cvs@mail.kde.org
http://mail.kde.org/mailman/listinfo/atlantik-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic