mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Use local path instead of appData
This commit is contained in:
parent
92c09aa2bd
commit
10262a41be
@ -1,4 +1,5 @@
|
|||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
#include <QGuiApplication>
|
||||||
|
|
||||||
Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListModel* ilm, SDKConnector* sdkc, AppId_t steamID, QGuiApplication* app, QObject* parent)
|
Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListModel* ilm, SDKConnector* sdkc, AppId_t steamID, QGuiApplication* app, QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
@ -12,7 +13,7 @@ Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListMo
|
|||||||
m_qGuiApplication = app;
|
m_qGuiApplication = app;
|
||||||
|
|
||||||
QFile configTmp;
|
QFile configTmp;
|
||||||
QString appConfigLocation = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
QString appConfigLocation = QGuiApplication::applicationDirPath();
|
||||||
m_localSettingsPath = QUrl(appConfigLocation);
|
m_localSettingsPath = QUrl(appConfigLocation);
|
||||||
if (!QDir(appConfigLocation).exists()) {
|
if (!QDir(appConfigLocation).exists()) {
|
||||||
if (!QDir().mkdir(appConfigLocation)) {
|
if (!QDir().mkdir(appConfigLocation)) {
|
||||||
@ -263,7 +264,7 @@ void Settings::setPlayAll(bool isPlaying)
|
|||||||
void Settings::createDefaultConfig()
|
void Settings::createDefaultConfig()
|
||||||
{
|
{
|
||||||
|
|
||||||
QFile file(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/settings.json");
|
QFile file(QGuiApplication::applicationDirPath() + "/settings.json");
|
||||||
QFile defaultSettings(":/settings.json");
|
QFile defaultSettings(":/settings.json");
|
||||||
|
|
||||||
file.open(QIODevice::WriteOnly | QIODevice::Text);
|
file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||||
|
Loading…
Reference in New Issue
Block a user