Add ability to customize cache folder
Add an advanced settings page, currently only housing the "Cache" category Fix #541
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "common/NetworkData.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "singletons/Paths.hpp"
|
||||
#include "util/DebugCount.hpp"
|
||||
|
||||
@@ -42,9 +41,7 @@ QString NetworkData::getHash()
|
||||
void NetworkData::writeToCache(const QByteArray &bytes)
|
||||
{
|
||||
if (this->useQuickLoadCache_) {
|
||||
auto app = getApp();
|
||||
|
||||
QFile cachedFile(getPaths()->cacheDirectory + "/" + this->getHash());
|
||||
QFile cachedFile(getPaths()->cacheDirectory() + "/" + this->getHash());
|
||||
|
||||
if (cachedFile.open(QIODevice::WriteOnly)) {
|
||||
cachedFile.write(bytes);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "common/NetworkRequest.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "common/NetworkData.hpp"
|
||||
#include "common/NetworkManager.hpp"
|
||||
#include "common/Outcome.hpp"
|
||||
@@ -11,6 +10,7 @@
|
||||
|
||||
#include <QFile>
|
||||
#include <QtConcurrent>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace chatterino {
|
||||
@@ -145,9 +145,8 @@ void NetworkRequest::execute()
|
||||
|
||||
Outcome NetworkRequest::tryLoadCachedFile()
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
QFile cachedFile(getPaths()->cacheDirectory + "/" + this->data->getHash());
|
||||
QFile cachedFile(getPaths()->cacheDirectory() + "/" +
|
||||
this->data->getHash());
|
||||
|
||||
if (!cachedFile.exists()) {
|
||||
// File didn't exist
|
||||
|
||||
Reference in New Issue
Block a user