From 1c1403293485f35fd53db45aaa77a01cdd9627e7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 20:34:15 +0000 Subject: TQt4 port ktorrent This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1238733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- plugins/webinterface/httpserver.h | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'plugins/webinterface/httpserver.h') diff --git a/plugins/webinterface/httpserver.h b/plugins/webinterface/httpserver.h index 28be441..dcdfdfe 100644 --- a/plugins/webinterface/httpserver.h +++ b/plugins/webinterface/httpserver.h @@ -20,13 +20,13 @@ #ifndef HTTPSERVER_H #define HTTPSERVER_H -#include -#include -#include -#include +#include +#include +#include +#include #include -class QSocket; +class TQSocket; namespace bt { @@ -43,7 +43,7 @@ namespace kt struct Session { bool logged_in; - QTime last_access; + TQTime last_access; int sessionId; }; @@ -62,41 +62,42 @@ namespace kt - class HttpServer : public QServerSocket + class HttpServer : public TQServerSocket { Q_OBJECT + TQ_OBJECT public: HttpServer(CoreInterface *core, int port); virtual ~HttpServer(); void newConnection(int s); - void handleGet(HttpClientHandler* hdlr,const QHttpRequestHeader & hdr,bool do_not_check_session = false); - void handlePost(HttpClientHandler* hdlr,const QHttpRequestHeader & hdr,const QByteArray & data); + void handleGet(HttpClientHandler* hdlr,const TQHttpRequestHeader & hdr,bool do_not_check_session = false); + void handlePost(HttpClientHandler* hdlr,const TQHttpRequestHeader & hdr,const TQByteArray & data); void handleUnsupportedMethod(HttpClientHandler* hdlr); - bt::MMapFile* cacheLookup(const QString & name); - void insertIntoCache(const QString & name,bt::MMapFile* file); + bt::MMapFile* cacheLookup(const TQString & name); + void insertIntoCache(const TQString & name,bt::MMapFile* file); protected slots: void slotSocketReadyToRead(); void slotConnectionClosed(); private: - bool checkSession(const QHttpRequestHeader & hdr); - bool checkLogin(const QHttpRequestHeader & hdr,const QByteArray & data); - void setDefaultResponseHeaders(HttpResponseHeader & hdr,const QString & content_type,bool with_session_info); - void handleTorrentPost(HttpClientHandler* hdlr,const QHttpRequestHeader & hdr,const QByteArray & data); - QDateTime parseDate(const QString & str); + bool checkSession(const TQHttpRequestHeader & hdr); + bool checkLogin(const TQHttpRequestHeader & hdr,const TQByteArray & data); + void setDefaultResponseHeaders(HttpResponseHeader & hdr,const TQString & content_type,bool with_session_info); + void handleTorrentPost(HttpClientHandler* hdlr,const TQHttpRequestHeader & hdr,const TQByteArray & data); + TQDateTime parseDate(const TQString & str); void redirectToLoginPage(HttpClientHandler* hdlr); private: - QString rootDir; + TQString rootDir; int sessionTTL; PhpInterface *php_i; Session session; - bt::PtrMap clients; + bt::PtrMap clients; CoreInterface *core; - QCache cache; + TQCache cache; }; -- cgit v1.2.3