Fixed boolean options in connector/protocol settings
This commit is contained in:
parent
200e1e4a1c
commit
28f0f15937
2 changed files with 38 additions and 39 deletions
|
@ -94,7 +94,12 @@ namespace Controller{
|
||||||
static inline void builPipedPart(JSON::Value &p, char *argarr[], int &argnum, const JSON::Value &argset){
|
static inline void builPipedPart(JSON::Value &p, char *argarr[], int &argnum, const JSON::Value &argset){
|
||||||
jsonForEachConst(argset, it){
|
jsonForEachConst(argset, it){
|
||||||
if (it->isMember("option") && p.isMember(it.key())){
|
if (it->isMember("option") && p.isMember(it.key())){
|
||||||
if (it->isMember("type")){
|
if (!it->isMember("type")){
|
||||||
|
if (JSON::Value(p[it.key()]).asBool()){
|
||||||
|
argarr[argnum++] = (char *)((*it)["option"].c_str());
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ((*it)["type"].asStringRef() == "str" && !p[it.key()].isString()){
|
if ((*it)["type"].asStringRef() == "str" && !p[it.key()].isString()){
|
||||||
p[it.key()] = p[it.key()].asString();
|
p[it.key()] = p[it.key()].asString();
|
||||||
}
|
}
|
||||||
|
@ -110,20 +115,10 @@ namespace Controller{
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (p[it.key()].asStringRef().size() > 0){
|
if (p[it.key()].asStringRef().size() > 0){
|
||||||
argarr[argnum++] = (char *)((*it)["option"].c_str());
|
argarr[argnum++] = (char *)((*it)["option"].c_str());
|
||||||
argarr[argnum++] = (char *)(p[it.key()].c_str());
|
argarr[argnum++] = (char *)(p[it.key()].c_str());
|
||||||
}else{
|
}else{
|
||||||
if (it.key() == "debug"){
|
|
||||||
if (Util::printDebugLevel != DEBUG){
|
|
||||||
static std::string debugLvlStr;
|
|
||||||
debugLvlStr = JSON::Value(Util::printDebugLevel).asString();
|
|
||||||
argarr[argnum++] = (char *)((*it)["option"].asStringRef().c_str());
|
|
||||||
argarr[argnum++] = (char *)debugLvlStr.c_str();
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
argarr[argnum++] = (char *)((*it)["option"].c_str());
|
argarr[argnum++] = (char *)((*it)["option"].c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,10 +356,15 @@ namespace Mist{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void builPipedPart(JSON::Value &p, char *argarr[], int &argnum, JSON::Value &argset){
|
static inline void builPipedPart(JSON::Value &p, char *argarr[], int &argnum, const JSON::Value &argset){
|
||||||
jsonForEach(argset, it){
|
jsonForEachConst(argset, it){
|
||||||
if (it->isMember("option") && p.isMember(it.key())){
|
if (it->isMember("option") && p.isMember(it.key())){
|
||||||
if (it->isMember("type")){
|
if (!it->isMember("type")){
|
||||||
|
if (JSON::Value(p[it.key()]).asBool()){
|
||||||
|
argarr[argnum++] = (char *)((*it)["option"].c_str());
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ((*it)["type"].asStringRef() == "str" && !p[it.key()].isString()){
|
if ((*it)["type"].asStringRef() == "str" && !p[it.key()].isString()){
|
||||||
p[it.key()] = p[it.key()].asString();
|
p[it.key()] = p[it.key()].asString();
|
||||||
}
|
}
|
||||||
|
@ -375,7 +380,6 @@ namespace Mist{
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (p[it.key()].asStringRef().size() > 0){
|
if (p[it.key()].asStringRef().size() > 0){
|
||||||
argarr[argnum++] = (char *)((*it)["option"].c_str());
|
argarr[argnum++] = (char *)((*it)["option"].c_str());
|
||||||
argarr[argnum++] = (char *)(p[it.key()].c_str());
|
argarr[argnum++] = (char *)(p[it.key()].c_str());
|
||||||
|
|
Loading…
Add table
Reference in a new issue