From 4f1ff5b56683a7da6da97446eb73ebbc78ab0217 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Mon, 16 Dec 2013 13:55:04 -0600 Subject: [PATCH] Using QStandardPaths for cache directory --- interface/src/Application.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 942cf998d9..267786edb9 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -218,9 +218,11 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : connect(silentNodeTimer, SIGNAL(timeout()), nodeList, SLOT(removeSilentNodes())); silentNodeTimer->start(NODE_SILENCE_THRESHOLD_USECS / 1000); + QString cachePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation); + _networkAccessManager = new QNetworkAccessManager(this); QNetworkDiskCache* cache = new QNetworkDiskCache(_networkAccessManager); - cache->setCacheDirectory("interfaceCache"); + cache->setCacheDirectory(!cachePath.isEmpty() ? cachePath : "interfaceCache"); _networkAccessManager->setCache(cache); _window->setCentralWidget(_glWidget);