-rw-r--r-- | korganizer/mainwindow.h | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 5985d56..7b4fd27 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -29,12 +29,5 @@ class KServerSocket : public QServerSocket public: - KServerSocket ( Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ) : - QServerSocket( port, backlog, parent, name ){;}; - void newConnection ( int socket ) - { - qDebug("KServerSocket:New connection %d ", socket); - QSocket* s = new QSocket( this ); - connect( s, SIGNAL(readyRead()), this, SLOT(readClient()) ); - connect( s, SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); - s->setSocket( socket ); - } + KServerSocket ( Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); + + void newConnection ( int socket ) ; @@ -45,25 +38,4 @@ signals: private slots: - void discardClient() - { - QSocket* socket = (QSocket*)sender(); - delete socket; - //emit endConnect(); - } - void readClient() - { - qDebug("readClient() "); - QSocket* socket = (QSocket*)sender(); - if ( socket->canReadLine() ) { - QStringList tokens = QStringList::split( QRegExp("[ \r\n][ \r\n]*"), socket->readLine() ); - if ( tokens[0] == "GET" ) { - emit sendFile( socket ); - } - if ( tokens[0] == "PUT" ) { - emit getFile( socket ); - } - if ( tokens[0] == "STOP" ) { - emit endConnect(); - } - } - } + void discardClient(); + void readClient(); }; |