diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-06-02 19:29:54 +0000 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-06-02 19:29:54 +0000 |
| commit | 44bc9157ee5437bd36abbbe483e1e0e81c15b839 (patch) | |
| tree | 4ec76f6d87e363c89a3a6cb689f8b15b3861baac | |
| parent | 758072173ec6e3551c451f55b744d38e87b7a9dd (diff) | |
| download | rockbox-44bc9157ee5437bd36abbbe483e1e0e81c15b839.zip rockbox-44bc9157ee5437bd36abbbe483e1e0e81c15b839.tar.gz rockbox-44bc9157ee5437bd36abbbe483e1e0e81c15b839.tar.bz2 rockbox-44bc9157ee5437bd36abbbe483e1e0e81c15b839.tar.xz | |
Extend http class to allow retrieving of the server timestamp once a file has been downloaded.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17680 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | rbutil/rbutilqt/httpget.cpp | 3 | ||||
| -rw-r--r-- | rbutil/rbutilqt/httpget.h | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/httpget.cpp b/rbutil/rbutilqt/httpget.cpp index a1385c5..4881556 100644 --- a/rbutil/rbutilqt/httpget.cpp +++ b/rbutil/rbutilqt/httpget.cpp @@ -45,6 +45,9 @@ HttpGet::HttpGet(QObject *parent) setProxy(m_globalProxy); m_usecache = false; m_cachedir = m_globalCache; + + m_serverTimestamp = QDateTime(); + connect(&http, SIGNAL(done(bool)), this, SLOT(httpDone(bool))); connect(&http, SIGNAL(dataReadProgress(int, int)), this, SLOT(httpProgress(int, int))); connect(&http, SIGNAL(requestFinished(int, bool)), this, SLOT(httpFinished(int, bool))); diff --git a/rbutil/rbutilqt/httpget.h b/rbutil/rbutilqt/httpget.h index 2b3faf1..c8d7269 100644 --- a/rbutil/rbutilqt/httpget.h +++ b/rbutil/rbutilqt/httpget.h @@ -43,7 +43,10 @@ class HttpGet : public QObject void setCache(bool); int httpResponse(void); QByteArray readAll(void); - bool isCached() { return m_cached; } + bool isCached() + { return m_cached; } + QDateTime timestamp(void) + { return m_serverTimestamp; } 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 |