QTfrontend/hwmap.cpp
changeset 169 a78d4a552500
parent 168 679e9b8912f5
child 170 ef1031ba44fc
--- a/QTfrontend/hwmap.cpp	Tue Sep 26 17:50:14 2006 +0000
+++ b/QTfrontend/hwmap.cpp	Tue Sep 26 19:45:47 2006 +0000
@@ -5,7 +5,6 @@
 #include <QMessageBox>
 
 #include <QMutex>
-#include <QDebug>
 
 #include <QList>
 
@@ -16,6 +15,9 @@
 HWMap::HWMap() :
   m_isStarted(false)
 {
+  IPCServer = new QTcpServer(this);
+  connect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection()));
+  IPCServer->setMaxPendingConnections(1);
 }
 
 HWMap::~HWMap()
@@ -34,17 +36,15 @@
   im.setNumColors(2);
 
   IPCSocket->close();
-  IPCSocket->deleteLater();
-  IPCSocket = 0;
+  //IPCSocket->deleteLater();
+  //IPCSocket = 0;
   IPCServer->close();
   //deleteLater();
 
 
   tcpSrvMut.lock();
   if(isBusy) --isBusy;
-  //if(!isBusy) srvsList.pop_front();//lastStarted=0;
   tcpSrvMut.unlock();
-  qDebug() << "image emitted with seed " << QString(m_seed.c_str());
   emit ImageReceived(im);
   readbuffer.clear();
   emit isReadyNow();
@@ -89,8 +89,6 @@
 
 void HWMap::tcpServerReady()
 {
-  qDebug() << "received signal, i am " << this << ";";
-  qDebug() << srvsList.front() << " disconnected from " << *(++srvsList.begin());
   tcpSrvMut.lock();
   disconnect(srvsList.front(), SIGNAL(isReadyNow()), *(++srvsList.begin()), SLOT(tcpServerReady()));
   srvsList.pop_front();
@@ -103,12 +101,10 @@
 {
   tcpSrvMut.lock();
   if(!isBusy) {
-    qDebug() << "notBusy, i am " << this;
     ++isBusy;
     srvsList.push_back(this);
     tcpSrvMut.unlock();
   } else {
-    qDebug() << "Busy, connected " << srvsList.back() << " to " << this;
     connect(srvsList.back(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
     srvsList.push_back(this);
     //deleteLater();
@@ -121,9 +117,6 @@
 
 void HWMap::RealStart()
 {
-  IPCServer = new QTcpServer(this);
-  connect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection()));
-  IPCServer->setMaxPendingConnections(1);
   IPCSocket = 0;
   if (!IPCServer->listen(QHostAddress::LocalHost, IPC_PORT)) {
     QMessageBox::critical(0, tr("Error"),