diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 20:34:15 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 20:34:15 +0000 |
commit | 1c1403293485f35fd53db45aaa77a01cdd9627e7 (patch) | |
tree | 38559cd68cd4f63023fb5f6375def9db3b8b491e /plugins/webinterface/httpserver.h | |
parent | 894f94545727610df22c4f73911d62d58266f695 (diff) | |
download | ktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.tar.gz ktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.zip |
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
Diffstat (limited to 'plugins/webinterface/httpserver.h')
-rw-r--r-- | plugins/webinterface/httpserver.h | 39 |
1 files changed, 20 insertions, 19 deletions
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 <qcache.h> -#include <qhttp.h> -#include <qdatetime.h> -#include <qserversocket.h> +#include <tqcache.h> +#include <tqhttp.h> +#include <tqdatetime.h> +#include <tqserversocket.h> #include <util/ptrmap.h> -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<QSocket*,HttpClientHandler> clients; + bt::PtrMap<TQSocket*,HttpClientHandler> clients; CoreInterface *core; - QCache<bt::MMapFile> cache; + TQCache<bt::MMapFile> cache; }; |