Skip to content

Commit

Permalink
Make cache path defined before class definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Yunusemre Şentürk <[email protected]>
  • Loading branch information
Yunusemre Şentürk committed Jan 21, 2019
1 parent fc391df commit 5dc4d58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/namfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <QStandardPaths>
#include <QDir>

#define CACHE_PATH "/.cache/pardus-store/"

class StoreNetworkAccessManager : public QNetworkAccessManager
{
public:
Expand Down Expand Up @@ -37,7 +39,7 @@ QNetworkAccessManager *NamFactory::create(QObject *parent)
{
QNetworkAccessManager *nam = new StoreNetworkAccessManager(parent);
QNetworkDiskCache *cache = new QNetworkDiskCache(nam);
cache->setCacheDirectory(QDir::homePath().append("/.cache/pardus-store/"));
cache->setCacheDirectory(QDir::homePath().append(QString(CACHE_PATH)));
nam->setCache(cache);
return nam;
}
Expand Down

0 comments on commit 5dc4d58

Please sign in to comment.