always output latest version of config file to webui (#307)

* always output latest version of config file to webui

* fix permissions after default config export

* tune code

* set permissions for exported effects

* use qt setperm instead of chmod
update effects code style a bit

* add fallback when config is not readable
This commit is contained in:
redPanther
2016-12-03 21:11:52 +01:00
committed by GitHub
parent 82a140f5ed
commit 5b0e401ca5
8 changed files with 42 additions and 37 deletions

View File

@@ -1042,8 +1042,15 @@ void JsonClientConnection::handleConfigGetCommand(const QJsonObject& message, co
result["success"] = true;
result["command"] = command;
result["tan"] = tan;
const QJsonObject & config = _hyperion->getQJsonConfig();
result["result"] = config;
try
{
result["result"] = QJsonFactory::readJson(QString::fromStdString(_hyperion->getConfigFileName()));
}
catch(...)
{
result["result"] = _hyperion->getQJsonConfig();
}
// send the result
sendMessage(result);