diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-03-05 21:12:24 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-03-05 21:12:24 +0000 |
commit | 5a75184c4abfd2c8fa2a3ee705b94fc800d7b918 (patch) | |
tree | dcbb9529aafc259fd8922b471c8ff537bb48a8fe /rbutil/rbutilqt/httpget.h | |
parent | 0def1dd23cf1990536122d35ed040173ddaa06ba (diff) | |
download | rockbox-5a75184c4abfd2c8fa2a3ee705b94fc800d7b918.tar.gz rockbox-5a75184c4abfd2c8fa2a3ee705b94fc800d7b918.zip |
add global proxy / cache settings to httpget class. This removes the need of passing proxy / cache values around all the time. Each object can still override the global values.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16530 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/httpget.h')
-rw-r--r-- | rbutil/rbutilqt/httpget.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/httpget.h b/rbutil/rbutilqt/httpget.h index 4a3d811e05..79522f6e8f 100644 --- a/rbutil/rbutilqt/httpget.h +++ b/rbutil/rbutilqt/httpget.h | |||
@@ -35,6 +35,7 @@ class HttpGet : public QObject | |||
35 | 35 | ||
36 | bool getFile(const QUrl &url); | 36 | bool getFile(const QUrl &url); |
37 | void setProxy(const QUrl &url); | 37 | void setProxy(const QUrl &url); |
38 | void setProxy(bool); | ||
38 | QHttp::Error error(void); | 39 | QHttp::Error error(void); |
39 | QString errorString(void); | 40 | QString errorString(void); |
40 | void setFile(QFile*); | 41 | void setFile(QFile*); |
@@ -43,6 +44,10 @@ class HttpGet : public QObject | |||
43 | int httpResponse(void); | 44 | int httpResponse(void); |
44 | QByteArray readAll(void); | 45 | QByteArray readAll(void); |
45 | bool isCached() { return cached; } | 46 | bool isCached() { return cached; } |
47 | static void setGlobalCache(const QDir d) //< set global cache path | ||
48 | { m_globalCache = d; } | ||
49 | static void setGlobalProxy(const QUrl p) //< set global proxy value | ||
50 | { m_globalProxy = p; } | ||
46 | 51 | ||
47 | public slots: | 52 | public slots: |
48 | void abort(void); | 53 | void abort(void); |
@@ -61,9 +66,9 @@ class HttpGet : public QObject | |||
61 | void httpStarted(int); | 66 | void httpStarted(int); |
62 | 67 | ||
63 | private: | 68 | private: |
64 | QHttp http; | 69 | QHttp http; //< download object |
65 | QFile *outputFile; | 70 | QFile *outputFile; |
66 | int response; | 71 | int response; //< http response |
67 | int getRequest; | 72 | int getRequest; |
68 | QByteArray dataBuffer; | 73 | QByteArray dataBuffer; |
69 | bool outputToBuffer; | 74 | bool outputToBuffer; |
@@ -72,6 +77,9 @@ class HttpGet : public QObject | |||
72 | QDir m_cachedir; | 77 | QDir m_cachedir; |
73 | QString cachefile; | 78 | QString cachefile; |
74 | bool cached; | 79 | bool cached; |
80 | QUrl m_proxy; | ||
81 | static QDir m_globalCache; //< global cache path value | ||
82 | static QUrl m_globalProxy; //< global proxy value | ||
75 | }; | 83 | }; |
76 | 84 | ||
77 | #endif | 85 | #endif |