diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-05-17 19:36:54 +0000 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-05-17 19:36:54 +0000 |
| commit | e338fc9130407ea01fa9c8c2244b6d2a69cd0921 (patch) | |
| tree | 27f6a8a62f674f89173f8008084b99fe1f9c3169 | |
| parent | be28f8441b84765caf334d1f5f0b3fe50b3b6b35 (diff) | |
| download | rockbox-e338fc9130407ea01fa9c8c2244b6d2a69cd0921.zip rockbox-e338fc9130407ea01fa9c8c2244b6d2a69cd0921.tar.gz rockbox-e338fc9130407ea01fa9c8c2244b6d2a69cd0921.tar.bz2 rockbox-e338fc9130407ea01fa9c8c2244b6d2a69cd0921.tar.xz | |
Allow http caching to use the old dumb mode again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17560 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | rbutil/rbutilqt/httpget.cpp | 5 | ||||
| -rw-r--r-- | rbutil/rbutilqt/httpget.h | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/httpget.cpp b/rbutil/rbutilqt/httpget.cpp index fcc2d41..a1385c5 100644 --- a/rbutil/rbutilqt/httpget.cpp +++ b/rbutil/rbutilqt/httpget.cpp @@ -25,13 +25,14 @@ QDir HttpGet::m_globalCache; //< global cach path value for new objects QUrl HttpGet::m_globalProxy; //< global proxy value for new objects +bool HttpGet::m_globalDumbCache = false; //< globally set cache "dumb" mode HttpGet::HttpGet(QObject *parent) : QObject(parent) { outputToBuffer = true; m_cached = false; - m_noHeaderCheck = false; + m_dumbCache = m_globalDumbCache; getRequest = -1; // if a request is cancelled before a reponse is available return some // hint about this in the http response instead of nonsense. @@ -199,7 +200,7 @@ bool HttpGet::getFile(const QUrl &url) m_hash = QCryptographicHash::hash(url.toEncoded(), QCryptographicHash::Md5).toHex(); m_path = QString(QUrl::toPercentEncoding(url.path(), "/")); - if(m_noHeaderCheck || !m_usecache) { + if(m_dumbCache || !m_usecache) { getFileFinish(); } else { diff --git a/rbutil/rbutilqt/httpget.h b/rbutil/rbutilqt/httpget.h index acf86dd..2b3faf1 100644 --- a/rbutil/rbutilqt/httpget.h +++ b/rbutil/rbutilqt/httpget.h @@ -44,11 +44,14 @@ class HttpGet : public QObject int httpResponse(void); QByteArray readAll(void); bool isCached() { return m_cached; } - void setNoHeaderCheck(bool b) { m_noHeaderCheck = b; } //< disable checking of http header timestamp for caching + void setDumbCache(bool b) //< disable checking of http header timestamp for caching + { m_dumbCache = b; } 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; } + static void setGlobalDumbCache(bool b) //< set "dumb" (ignore server status) caching mode + { m_globalDumbCache = b; } public slots: void abort(void); @@ -84,11 +87,12 @@ class HttpGet : public QObject QUrl m_proxy; static QDir m_globalCache; //< global cache path value static QUrl m_globalProxy; //< global proxy value + static bool m_globalDumbCache; //< cache "dumb" mode global setting QDateTime m_serverTimestamp; //< timestamp of file on server QString m_query; //< constructed query to pass http getter QString m_path; //< constructed path to pass http getter QString m_hash; //< caching hash - bool m_noHeaderCheck; //< true if caching should ignore the server header + bool m_dumbCache; //< true if caching should ignore the server header }; #endif |