Fix bug that prevented aquireing new items

Add save button to master that saves json file
Remove autosave on quit
This commit is contained in:
uvos 2021-10-02 14:12:58 +02:00
parent 5fb9ca7cc0
commit 954eec754c
14 changed files with 61 additions and 18 deletions

View file

@ -56,12 +56,6 @@ MainObject::MainObject(QIODevice* ioDevice, const QString& settingsPathIn, const
MainObject::~MainObject()
{
if(master)
{
QJsonObject json;
store(json);
if(!noSave)storeJsonObjectToDisk(json, settingsPath);
}
}
void MainObject::store(QJsonObject &json)
@ -98,9 +92,20 @@ void MainObject::load(const QJsonObject& json)
micro.requestState();
}
void MainObject::storeToDisk()
{
if(master && !noSave)
{
QJsonObject json;
store(json);
storeJsonObjectToDisk(json, settingsPath);
}
}
void MainObject::recivedJson(const QJsonObject json)
{
if(master && !noSave)storeJsonObjectToDisk(json, settingsPath);
if(master && !noSave)
storeJsonObjectToDisk(json, settingsPath);
load(json);
}