From 3fb33449aa8a10f6d0ffa1564c80331300521800 Mon Sep 17 00:00:00 2001 From: m1tk4 Date: Thu, 2 Jan 2025 23:30:07 -0500 Subject: [PATCH] save config.json formatted / human readable --- src/controller/controller_storage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controller/controller_storage.cpp b/src/controller/controller_storage.cpp index 18ea726d3..03b32bd44 100644 --- a/src/controller/controller_storage.cpp +++ b/src/controller/controller_storage.cpp @@ -276,7 +276,7 @@ namespace Controller{ JSON::Value tmpConf = JSON::fromFile(cs->asStringRef()); tmpConf[cs.key()] = tmp[cs.key()]; // Attempt to write this section to the given file - if (!Controller::WriteFile(cs->asStringRef(), tmpConf.toString())){ + if (!Controller::WriteFile(cs->asStringRef(), tmpConf.toPrettyString())){ success = false; // Only print the error + config data if this is new data since the last write attempt if (tmp[cs.key()] != lastConfigWriteAttempt[cs.key()]){ @@ -298,7 +298,7 @@ namespace Controller{ // Only (attempt to) write if there was a change since last write success if (forceWrite || lastConfigWritten[""] != mainConfig){ // Attempt to write this section to the given file - if (!Controller::WriteFile(Controller::conf.getString("configFile"), tmp.toString())){ + if (!Controller::WriteFile(Controller::conf.getString("configFile"), tmp.toPrettyString())){ success = false; // Only print the error + config data if this is new data since the last write attempt if (tmp != lastConfigWriteAttempt){