summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/httpget.h
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/httpget.h')
-rw-r--r--rbutil/rbutilqt/httpget.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/rbutil/rbutilqt/httpget.h b/rbutil/rbutilqt/httpget.h
index 3ff00b4d55..acf86ddb95 100644
--- a/rbutil/rbutilqt/httpget.h
+++ b/rbutil/rbutilqt/httpget.h
@@ -43,7 +43,8 @@ class HttpGet : public QObject
43 void setCache(bool); 43 void setCache(bool);
44 int httpResponse(void); 44 int httpResponse(void);
45 QByteArray readAll(void); 45 QByteArray readAll(void);
46 bool isCached() { return cached; } 46 bool isCached() { return m_cached; }
47 void setNoHeaderCheck(bool b) { m_noHeaderCheck = b; } //< disable checking of http header timestamp for caching
47 static void setGlobalCache(const QDir d) //< set global cache path 48 static void setGlobalCache(const QDir d) //< set global cache path
48 { m_globalCache = d; } 49 { m_globalCache = d; }
49 static void setGlobalProxy(const QUrl p) //< set global proxy value 50 static void setGlobalProxy(const QUrl p) //< set global proxy value
@@ -56,6 +57,7 @@ class HttpGet : public QObject
56 void done(bool); 57 void done(bool);
57 void dataReadProgress(int, int); 58 void dataReadProgress(int, int);
58 void requestFinished(int, bool); 59 void requestFinished(int, bool);
60 void headerFinished(void);
59 61
60 private slots: 62 private slots:
61 void httpDone(bool error); 63 void httpDone(bool error);
@@ -64,23 +66,29 @@ class HttpGet : public QObject
64 void httpResponseHeader(const QHttpResponseHeader&); 66 void httpResponseHeader(const QHttpResponseHeader&);
65 void httpState(int); 67 void httpState(int);
66 void httpStarted(int); 68 void httpStarted(int);
69 void getFileFinish(void);
67 70
68 private: 71 private:
69 bool initializeCache(const QDir&); 72 bool initializeCache(const QDir&);
70 QHttp http; //< download object 73 QHttp http; //< download object
71 QFile *outputFile; 74 QFile *outputFile;
72 int response; //< http response 75 int m_response; //< http response
73 int getRequest; 76 int getRequest; //! get file http request id
77 int headRequest; //! get http header request id
74 QByteArray dataBuffer; 78 QByteArray dataBuffer;
75 bool outputToBuffer; 79 bool outputToBuffer;
76 QString query;
77 bool m_usecache; 80 bool m_usecache;
78 QDir m_cachedir; 81 QDir m_cachedir;
79 QString cachefile; 82 QString m_cachefile; // cached filename
80 bool cached; 83 bool m_cached;
81 QUrl m_proxy; 84 QUrl m_proxy;
82 static QDir m_globalCache; //< global cache path value 85 static QDir m_globalCache; //< global cache path value
83 static QUrl m_globalProxy; //< global proxy value 86 static QUrl m_globalProxy; //< global proxy value
87 QDateTime m_serverTimestamp; //< timestamp of file on server
88 QString m_query; //< constructed query to pass http getter
89 QString m_path; //< constructed path to pass http getter
90 QString m_hash; //< caching hash
91 bool m_noHeaderCheck; //< true if caching should ignore the server header
84}; 92};
85 93
86#endif 94#endif