From: Flavio Tordini Date: Mon, 3 Aug 2015 12:20:56 +0000 (+0200) Subject: use standard cache location X-Git-Tag: 2.5~59 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0fb134230ecd61735eb788f44de93a30a164aeec;p=minitube use standard cache location --- diff --git a/src/global.h b/src/global.h index e54b5d5..9306998 100644 --- a/src/global.h +++ b/src/global.h @@ -32,6 +32,7 @@ $END_LICENSE */ #include #include "networkaccess.h" #include "diskcache.h" +#include "compatibility/pathsservice.h" namespace The { @@ -148,12 +149,7 @@ namespace The { maybeSetSystemProxy(); nam = new QNetworkAccessManager(); QNetworkDiskCache *cache = new DiskCache(); -#if QT_VERSION >= 0x050000 - QString cacheLocation = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/qt5"; -#else - QString cacheLocation = QDesktopServices::storageLocation(QDesktopServices::DataLocation); -#endif - cache->setCacheDirectory(cacheLocation); + cache->setCacheDirectory(Paths::getCacheLocation()); nam->setCache(cache); } return nam; diff --git a/src/ytchannel.cpp b/src/ytchannel.cpp index cd5531c..c2b33aa 100644 --- a/src/ytchannel.cpp +++ b/src/ytchannel.cpp @@ -191,7 +191,7 @@ void YTChannel::loadThumbnail() { } const QString & YTChannel::getThumbnailDir() { - static const QString thumbDir = Paths::getDataLocation() + "/channels/"; + static const QString thumbDir = Paths::getCacheLocation() + "/channels/"; return thumbDir; }