|
|
@ -762,6 +762,9 @@ class Script: public QObject { |
|
|
|
_variables[name] = value; |
|
|
|
_variables[name] = value; |
|
|
|
_rvariables[value] = name; |
|
|
|
_rvariables[value] = name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
QStringList variables() { |
|
|
|
|
|
|
|
return _variables.keys(); |
|
|
|
|
|
|
|
} |
|
|
|
QString variable(QString name) { |
|
|
|
QString variable(QString name) { |
|
|
|
QMap<QString, QString>::iterator it(_variables.find(name)); |
|
|
|
QMap<QString, QString>::iterator it(_variables.find(name)); |
|
|
|
if (it==_variables.end()) throw VariableNotFound(name); |
|
|
|
if (it==_variables.end()) throw VariableNotFound(name); |
|
|
@ -1675,11 +1678,11 @@ class Set: public Command { |
|
|
|
Logger log(this, script); |
|
|
|
Logger log(this, script); |
|
|
|
if (_next) { |
|
|
|
if (_next) { |
|
|
|
_next->execute(script, frame); |
|
|
|
_next->execute(script, frame); |
|
|
|
script->set(script->replacevars(_name), |
|
|
|
script->set(_name, |
|
|
|
script->replacevars(_next->result())); |
|
|
|
script->replacevars(_next->result())); |
|
|
|
log(_name+"='"+_next->result().replace("\\", "\\\\").replace("'", "\\'")+"'"); |
|
|
|
log(_name+"='"+_next->result().replace("\\", "\\\\").replace("'", "\\'")+"'"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
script->set(script->replacevars(_name), |
|
|
|
script->set(_name, |
|
|
|
script->replacevars(_value)); |
|
|
|
script->replacevars(_value)); |
|
|
|
log(_name+"='"+_value.replace("\\", "\\\\").replace("'", "\\'")+"'"); |
|
|
|
log(_name+"='"+_value.replace("\\", "\\\\").replace("'", "\\'")+"'"); |
|
|
|
} |
|
|
|
} |
|
|
@ -2414,6 +2417,8 @@ inline bool Command::runScript(Command* parentCommand, |
|
|
|
disconnect(&scriptCopy, SIGNAL(logging(QString)), |
|
|
|
disconnect(&scriptCopy, SIGNAL(logging(QString)), |
|
|
|
parent, SLOT(parentlog(QString))); |
|
|
|
parent, SLOT(parentlog(QString))); |
|
|
|
parentCommand->_result = scriptCopy.result(); |
|
|
|
parentCommand->_result = scriptCopy.result(); |
|
|
|
|
|
|
|
Q_FOREACH(QString key, scriptCopy.variables()) |
|
|
|
|
|
|
|
if (!vars.contains(key)) parent->set(key, scriptCopy.variable(key)); |
|
|
|
if (parentCommand->_result.size()) |
|
|
|
if (parentCommand->_result.size()) |
|
|
|
parent->log("result: "+parentCommand->_result); |
|
|
|
parent->log("result: "+parentCommand->_result); |
|
|
|
return res; |
|
|
|
return res; |
|
|
|