mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Remove duplicated Code (#377)
* Reduce Duplicate Code * Reduce Duplicate Code * No Error Logging when "document_root" in Json config is empty * Update JsonClientConnection.cpp * Remove obsolete functions * create readConfig and readSchema function * set forgotten _error variable
This commit is contained in:
committed by
brindosch
parent
8a4d1c5088
commit
ed47852518
@@ -950,7 +950,7 @@ void JsonClientConnection::handleConfigGetCommand(const QJsonObject& message, co
|
||||
|
||||
try
|
||||
{
|
||||
result["result"] = QJsonFactory::readJson(QString::fromStdString(_hyperion->getConfigFileName()));
|
||||
result["result"] = QJsonFactory::readConfig(QString::fromStdString(_hyperion->getConfigFileName()));
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
|
@@ -115,6 +115,7 @@ void QJsonSchemaChecker::validate(const QJsonValue & value, const QJsonObject &s
|
||||
else
|
||||
{
|
||||
// no check function defined for this attribute
|
||||
_error = true;
|
||||
setMessage(std::string("No check function defined for attribute ") + attribute.toStdString());
|
||||
continue;
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ WebConfig::WebConfig(QObject * parent)
|
||||
_baseUrl = webconfigConfig["document_root"].toString(_baseUrl);
|
||||
}
|
||||
|
||||
if (_baseUrl != ":/webconfig")
|
||||
if ( (_baseUrl != ":/webconfig") && !_baseUrl.trimmed().isEmpty())
|
||||
{
|
||||
QFileInfo info(_baseUrl);
|
||||
if (!info.exists() || !info.isDir())
|
||||
@@ -32,6 +32,8 @@ WebConfig::WebConfig(QObject * parent)
|
||||
_baseUrl = WEBCONFIG_DEFAULT_PATH;
|
||||
}
|
||||
}
|
||||
else
|
||||
_baseUrl = WEBCONFIG_DEFAULT_PATH;
|
||||
|
||||
Debug(log, "WebUI initialized, document root: %s", _baseUrl.toUtf8().constData());
|
||||
if ( webconfigEnable )
|
||||
|
Reference in New Issue
Block a user