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
This commit is contained in:
Dominik Riebeling 2008-03-05 21:12:24 +00:00
parent 0def1dd23c
commit 5a75184c4a
14 changed files with 63 additions and 74 deletions

View file

@ -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