Commit d31ff116 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED remove empty extra paramaters element

parent 53313745
......@@ -1009,22 +1009,19 @@ void Application::saveHistoryAsSXML() {
actionElementName.appendChild(actionElementNameText);
// action parameters
QDomElement parametersElement = doc->createElement("camitk:parameters");
actionElement.appendChild(parametersElement);
if (!action->dynamicPropertyNames().isEmpty()) {
QDomElement parametersElement = doc->createElement("camitk:parameters");
actionElement.appendChild(parametersElement);
foreach (QByteArray actionParameter, action->dynamicPropertyNames()) {
QDomElement parameterElement = doc->createElement("camitk:parameter");
parametersElement.appendChild(parameterElement);
parameterElement.setAttribute("name", QString(actionParameter));
parameterElement.setAttribute("type", QVariant::typeToName(action->property(actionParameter).type()));
parameterElement.setAttribute("value", action->property(actionParameter.data()).toString());
parametersElement.appendChild(parameterElement);
}
}
QDomElement actionElementParam = doc->createElement("camitk:parameters");
actionElement.appendChild(actionElementParam);
// action input components
if (!historyItem.getInputHistoryComponents().isEmpty()) {
QDomElement actionElementInputComp = doc->createElement("camitk:inputs");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment