From 4d601f5383be9e9dc037dacec7870bdbab14468e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 21 Jul 2012 18:02:09 +0300 Subject: [PATCH] Fix build with Qt < 4.7 --- src/webui/btjson.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index d88efce1b..3fd68eb7b 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -35,10 +35,14 @@ #include "qbtsession.h" #include "torrentpersistentdata.h" +#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) #include +#endif using namespace libtorrent; +#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) + #define CACHED_VARIABLE(VARTYPE, VAR, DUR) \ static VARTYPE VAR; \ static QElapsedTimer cacheTimer; \ @@ -59,6 +63,16 @@ using namespace libtorrent; cacheTimer.start(); \ VAR.clear() +#else +// We don't support caching for Qt < 4.7 at the moment +#define CACHED_VARIABLE(VARTYPE, VAR, DUR) \ + VARTYPE VAR + +#define CACHED_VARIABLE_FOR_HASH(VARTYPE, VAR, DUR, HASH) \ + VARTYPE VAR + +#endif + // Numerical constants static const int CACHE_DURATION_MS = 1500; // 1500ms