portable: use portable storage folder to store QML disk cache

This commit is contained in:
xiphon
2020-11-24 22:41:05 +00:00
parent d5365298d2
commit ec8cd137cc
3 changed files with 18 additions and 8 deletions

View File

@@ -179,13 +179,13 @@ bool MoneroSettings::portable() const
return this->m_settings && this->m_settings->fileName() == portableFilePath();
}
bool MoneroSettings::portableConfigExists() const
bool MoneroSettings::portableConfigExists()
{
QFileInfo info(portableFilePath());
return info.exists() && info.isFile();
}
QString MoneroSettings::portableFilePath() const
QString MoneroSettings::portableFilePath()
{
static QString filename(QDir(portableFolderName()).absoluteFilePath("settings.ini"));
return filename;

View File

@@ -64,6 +64,7 @@ public:
Q_INVOKABLE void setWritable(bool enabled);
static QString portableFolderName();
static bool portableConfigExists();
public slots:
void _q_propertyChanged();
@@ -84,8 +85,7 @@ private:
void store();
bool portable() const;
bool portableConfigExists() const;
QString portableFilePath() const;
static QString portableFilePath();
std::unique_ptr<QSettings> portableSettings() const;
std::unique_ptr<QSettings> unportableSettings() const;
void swap(std::unique_ptr<QSettings> newSettings);