From 415e13ff44337148f907c6e8182fa8c1297eb591 Mon Sep 17 00:00:00 2001 From: bluebrother Date: Mon, 2 Jun 2008 19:29:54 +0000 Subject: [PATCH] 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 --- rbutil/rbutilqt/httpget.cpp | 3 +++ rbutil/rbutilqt/httpget.h | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rbutil/rbutilqt/httpget.cpp b/rbutil/rbutilqt/httpget.cpp index a1385c575..488155610 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 2b3faf18c..c8d7269fd 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 -- 2.11.4.GIT