Use default cache location for the plugin info caches

pull/684/head
Simon Stürz 2024-10-09 14:09:56 +02:00
parent 36adad329f
commit 81fdea51a8
1 changed files with 3 additions and 2 deletions

View File

@ -36,6 +36,7 @@
#include <QJsonDocument>
#include <QJsonObject>
#include "nymeasettings.h"
#include "loggingcategories.h"
PluginInfoCache::PluginInfoCache()
@ -46,7 +47,7 @@ PluginInfoCache::PluginInfoCache()
void PluginInfoCache::cachePluginInfo(const QJsonObject &metaData)
{
QString fileName = metaData.value("id").toString().remove(QRegExp("[{}]")) + ".cache";
QDir path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/plugininfo/";
QDir path = NymeaSettings::cachePath() + "/plugininfo/";
if (!path.exists()) {
if (!path.mkpath(path.absolutePath())) {
qCWarning(dcThingManager()) << "Error creating thing class cache dir at" << path.absolutePath();
@ -65,7 +66,7 @@ void PluginInfoCache::cachePluginInfo(const QJsonObject &metaData)
QJsonObject PluginInfoCache::loadPluginInfo(const PluginId &pluginId)
{
QString fileName = pluginId.toString().remove(QRegExp("[{}]")) + ".cache";
QDir path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/plugininfo/";
QDir path = NymeaSettings::cachePath() + "/plugininfo/";
QFile file(path.absoluteFilePath(fileName));
if (!file.open(QFile::ReadOnly)) {
return QJsonObject();