Commit e6cdb085 authored by Laurent Montel's avatar Laurent Montel 😁

Port foreverypart

parent 433d361a
......@@ -94,6 +94,27 @@ void SieveForEveryPartWidget::generatedScript(QString &script, QStringList &requ
void SieveForEveryPartWidget::loadScript(QXmlStreamReader &element, QString &error)
{
qDebug() << " void SieveForEveryPartWidget::loadScript(QXmlStreamReader &element, QString &error)";
element.readNextStartElement();
const QStringRef tagName = element.name();
if (tagName == QLatin1String("tag")) {
const QString tagValue = element.readElementText();
if (tagValue == QLatin1String("name")) {
mName->setText(AutoCreateScriptUtil::strValue(element));
} else {
error += i18n("Unknown tagValue \"%1\" during loading loop \"for\"", tagValue) + QLatin1Char('\n');
qCDebug(LIBKSIEVE_LOG) << " SieveForEveryPartWidget::loadScript unknown tagValue " << tagValue;
}
mForLoop->setChecked(true);
mName->setEnabled(true);
} else if (tagName == QLatin1String("block")) {
//Nothing
//It's when name is empty
} else if (tagName == QLatin1String("crlf")) {
//Nothing
} else {
error += i18n("Unknown tag \"%1\" during loading loop \"for\"", tagName.toString()) + QLatin1Char('\n');
qCDebug(LIBKSIEVE_LOG) << " SieveForEveryPartWidget::loadScript unknown tagName " << tagName;
}
#ifdef REMOVE_QDOMELEMENT
QDomNode node = element.firstChild();
QDomElement e = node.toElement();
......
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