-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 @@ -27,45 +27,17 @@ class KServerSocket : public QServerSocket Q_OBJECT 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 ) ; signals: void sendFile(QSocket*); void getFile(QSocket*); void endConnect(); 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(); }; |