summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/httpget.h
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-03-05 21:12:24 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-03-05 21:12:24 +0000
commit5a75184c4abfd2c8fa2a3ee705b94fc800d7b918 (patch)
treedcbb9529aafc259fd8922b471c8ff537bb48a8fe /rbutil/rbutilqt/httpget.h
parent0def1dd23cf1990536122d35ed040173ddaa06ba (diff)
downloadrockbox-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.h12
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
bool getFile(const QUrl &url);
void setProxy(const QUrl &url);
+ void setProxy(bool);
QHttp::Error error(void);
QString errorString(void);
void setFile(QFile*);
@@ -43,6 +44,10 @@ class HttpGet : public QObject
int httpResponse(void);
QByteArray readAll(void);
bool isCached() { return cached; }
+ static void setGlobalCache(const QDir d) //< set global cache path
+ { m_globalCache = d; }
+ static void setGlobalProxy(const QUrl p) //< set global proxy value
+ { m_globalProxy = p; }
public slots:
void abort(void);
@@ -61,9 +66,9 @@ class HttpGet : public QObject
void httpStarted(int);
private:
- QHttp http;
+ QHttp http; //< download object
QFile *outputFile;
- int response;
+ int response; //< http response
int getRequest;
QByteArray dataBuffer;
bool outputToBuffer;
@@ -72,6 +77,9 @@ class HttpGet : public QObject
QDir m_cachedir;
QString cachefile;
bool cached;
+ QUrl m_proxy;
+ static QDir m_globalCache; //< global cache path value
+ static QUrl m_globalProxy; //< global proxy value
};
#endif