summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.h
Unidiff
Diffstat (limited to 'korganizer/mainwindow.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.h38
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
@@ -18,63 +18,35 @@ class KSyncProfile;
18#define QPEMenuBar QMenuBar 18#define QPEMenuBar QMenuBar
19#endif 19#endif
20class QPEToolBar; 20class QPEToolBar;
21#include <qserversocket.h> 21#include <qserversocket.h>
22#include <qsocket.h> 22#include <qsocket.h>
23#include <qnetworkprotocol.h> 23#include <qnetworkprotocol.h>
24 24
25class KServerSocket : public QServerSocket 25class KServerSocket : public QServerSocket
26{ 26{
27 Q_OBJECT 27 Q_OBJECT
28 28
29public: 29public:
30 KServerSocket ( Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ) : 30 KServerSocket ( Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 );
31 QServerSocket( port, backlog, parent, name ){;}; 31
32 void newConnection ( int socket ) 32 void newConnection ( int socket ) ;
33 {
34 qDebug("KServerSocket:New connection %d ", socket);
35 QSocket* s = new QSocket( this );
36 connect( s, SIGNAL(readyRead()), this, SLOT(readClient()) );
37 connect( s, SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) );
38 s->setSocket( socket );
39 }
40 33
41signals: 34signals:
42 void sendFile(QSocket*); 35 void sendFile(QSocket*);
43 void getFile(QSocket*); 36 void getFile(QSocket*);
44 void endConnect(); 37 void endConnect();
45private slots: 38private slots:
46 void discardClient() 39 void discardClient();
47 { 40 void readClient();
48 QSocket* socket = (QSocket*)sender();
49 delete socket;
50 //emit endConnect();
51 }
52 void readClient()
53 {
54 qDebug("readClient() ");
55 QSocket* socket = (QSocket*)sender();
56 if ( socket->canReadLine() ) {
57 QStringList tokens = QStringList::split( QRegExp("[ \r\n][ \r\n]*"), socket->readLine() );
58 if ( tokens[0] == "GET" ) {
59 emit sendFile( socket );
60 }
61 if ( tokens[0] == "PUT" ) {
62 emit getFile( socket );
63 }
64 if ( tokens[0] == "STOP" ) {
65 emit endConnect();
66 }
67 }
68 }
69}; 41};
70 42
71 43
72namespace KCal { 44namespace KCal {
73class CalendarLocal; 45class CalendarLocal;
74} 46}
75 47
76using namespace KCal; 48using namespace KCal;
77 49
78class MainWindow : public QMainWindow 50class MainWindow : public QMainWindow
79{ 51{
80 Q_OBJECT 52 Q_OBJECT