Commit 3ea29c55 authored by Laurent Montel's avatar Laurent Montel 😁

Fix autotest 60 success now

parent 609bb85a
......@@ -25,6 +25,7 @@
#include <KPluginFactory>
#include <QStringList>
#include <QRegularExpression>
#include <QDebug>
#include "autocreatescripts/sieveconditions/widgets/regexpeditorlineedit.h"
using namespace KSieveUi;
......@@ -133,8 +134,10 @@ QString AutoCreateScriptUtil::tagValue(const QString &tag)
QString AutoCreateScriptUtil::strValue(QXmlStreamReader &node)
{
qDebug() << " QString AutoCreateScriptUtil::strValue(QXmlStreamReader &node)66666666666666666666666";
if (node.readNextStartElement()) {
const QStringRef textElementTagName = node.name();
qDebug() << "SSSSSSSSSSSSSSSSSSSSSSSSSSSSS QString AutoCreateScriptUtil::strValue(QXmlStreamReader &node)"<<textElementTagName;
if (textElementTagName == QLatin1String("str")) {
return node.readElementText();
}
......
......@@ -55,8 +55,10 @@ bool SieveActionAbstractFlags::setParamWidgetValue(QXmlStreamReader &element, QW
SelectFlagsWidget *flagsWidget = w->findChild<SelectFlagsWidget *>(QStringLiteral("flagswidget"));
flagsWidget->setFlags(QStringList() << element.readElementText());
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
element.skipCurrentElement();
//implement in the future ?
} else {
unknownTag(tagName, error);
......
......@@ -88,8 +88,10 @@ bool SieveActionAddHeader::setParamWidgetValue(QXmlStreamReader &element, QWidge
}
++index;
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
element.skipCurrentElement();
//implement in the future ?
} else {
unknownTag(tagName, error);
......
......@@ -53,22 +53,29 @@ QWidget *SieveActionBreak::createParamWidget(QWidget *parent) const
bool SieveActionBreak::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, QString &error)
{
qDebug() << " bool SieveActionBreak::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, QString &error)";
while (element.readNextStartElement()) {
const QStringRef tagName = element.name();
qDebug() << " tagName " << tagName;
if (tagName == QLatin1String("tag")) {
const QString tagValue = element.readElementText();
qDebug() << " bool SieveActionBreak::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, QString &error)"<<tagValue;
if (tagValue == QLatin1String("name")) {
QLineEdit *name = w->findChild<QLineEdit *>(QStringLiteral("name"));
name->setText(AutoCreateScriptUtil::strValue(element));
qDebug() << " NAME !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<name->text();
} else {
unknowTagValue(tagValue, error);
qCDebug(LIBKSIEVE_LOG) << " SieveActionBreak::setParamWidgetValue unknown tagValue " << tagValue;
}
} else if (tagName == QLatin1String("str")) {
element.skipCurrentElement();
//Nothing
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
element.skipCurrentElement();
//implement in the future ?
} else {
unknownTag(tagName, error);
......
......@@ -89,8 +89,10 @@ bool SieveActionConvert::setParamWidgetValue(QXmlStreamReader &element, QWidget
SelectConvertParameterWidget *params = w->findChild<SelectConvertParameterWidget *>(QStringLiteral("params"));
params->setCode(AutoCreateScriptUtil::listValue(element), error);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
element.skipCurrentElement();
//implement in the future ?
} else {
unknownTag(tagName, error);
......
......@@ -73,12 +73,14 @@ bool SieveActionDeleteHeader::parseValue(QXmlStreamReader &element, QWidget *w,
while (element.readNextStartElement()) {
const QStringRef tagName = element.name();
if (tagName == QLatin1String("test")) {
#ifdef FIXME_QDOMELEMENT
const QDomNode testNode = e.toElement();
const QString nameValue = e.attribute(QStringLiteral("name"), QString());
QString nameValue;
if (element.attributes().hasAttribute(QStringLiteral("name"))) {
nameValue = element.attributes().value(QStringLiteral("name")).toString();
}
const bool isNegative = (nameValue == QLatin1String("not"));
return parseValue(element, w, error, isNegative);
#endif
bool result = parseValue(element, w, error, isNegative);
element.skipCurrentElement();
return result;
} else if (tagName == QLatin1String("tag")) {
SelectMatchTypeComboBox *combo = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtype"));
combo->setCode(AutoCreateScriptUtil::tagValueWithCondition(element.readElementText(), isNegative), name(), error);
......@@ -95,8 +97,10 @@ bool SieveActionDeleteHeader::parseValue(QXmlStreamReader &element, QWidget *w,
}
++index;
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
element.skipCurrentElement();
//implement in the future ?
} else {
unknownTag(tagName, error);
......
......@@ -95,8 +95,10 @@ bool SieveActionEnclose::setParamWidgetValue(QXmlStreamReader &element, QWidget
MultiLineEdit *edit = w->findChild<MultiLineEdit *>(QStringLiteral("text"));
edit->setPlainText(element.readElementText());
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
element.skipCurrentElement();
//implement in the future ?
} else {
unknownTag(tagName, error);
......
......@@ -59,6 +59,7 @@ bool SieveActionEReject::setParamWidgetValue(QXmlStreamReader &element, QWidget
MultiLineEdit *edit = w->findChild<MultiLineEdit *>(QStringLiteral("rejectmessage"));
edit->setPlainText(AutoCreateScriptUtil::quoteStr(tagValue));
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
//implement in the future ?
......
......@@ -68,6 +68,7 @@ bool SieveActionExtractText::setParamWidgetValue(QXmlStreamReader &element, QWid
const QStringRef tagName = element.name();
if (tagName == QLatin1String("tag")) {
element.skipCurrentElement();
//TODO ?
} else if (tagName == QLatin1String("num")) {
QSpinBox *numberOfCharacters = w->findChild<QSpinBox *>(QStringLiteral("numberOfCharacters"));
......@@ -76,6 +77,7 @@ bool SieveActionExtractText::setParamWidgetValue(QXmlStreamReader &element, QWid
QLineEdit *variableName = w->findChild<QLineEdit *>(QStringLiteral("variablename"));
variableName->setText(element.readElementText());
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
//implement in the future ?
......
......@@ -90,6 +90,7 @@ bool SieveActionFileInto::setParamWidgetValue(QXmlStreamReader &element, QWidget
KSieveUi::AbstractMoveImapFolderWidget *edit = w->findChild<KSieveUi::AbstractMoveImapFolderWidget *>(QStringLiteral("fileintolineedit"));
edit->setText(AutoCreateScriptUtil::protectSlash(tagValue));
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
//implement in the future ?
......
......@@ -91,6 +91,7 @@ bool SieveActionKeep::setParamWidgetValue(QXmlStreamReader &element, QWidget *w,
} else if (tagName == QLatin1String("tag") && element.readElementText() == QLatin1String("flags")) {
//nothing :)
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
//implement in the future ?
......
......@@ -90,6 +90,7 @@ bool SieveActionNotify::setParamWidgetValue(QXmlStreamReader &element, QWidget *
qCDebug(LIBKSIEVE_LOG) << " SieveActionNotify::setParamWidgetValue unknown tagValue" << tagValue;
}
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
//implement in the future ?
......
......@@ -93,6 +93,7 @@ bool SieveActionRedirect::setParamWidgetValue(QXmlStreamReader &element, QWidget
qCDebug(LIBKSIEVE_LOG) << " SieveActionRedirect::setParamWidgetValue tagValue unknown" << tagValue;
}
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
setComment(element.readElementText());
......
......@@ -59,6 +59,7 @@ bool SieveActionReject::setParamWidgetValue(QXmlStreamReader &element, QWidget *
MultiLineEdit *edit = w->findChild<MultiLineEdit *>(QStringLiteral("rejectmessage"));
edit->setPlainText(AutoCreateScriptUtil::quoteStr(tagValue));
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
//implement in the future ?
......
......@@ -95,6 +95,7 @@ bool SieveActionReplace::setParamWidgetValue(QXmlStreamReader &element, QWidget
qCDebug(LIBKSIEVE_LOG) << " SieveActionReplace::setParamWidgetValue unknown tagValue " << tagValue;
}
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
//implement in the future ?
......
......@@ -89,19 +89,15 @@ bool SieveActionSetVariable::setParamWidgetValue(QXmlStreamReader &element, QWid
const QString tagValue = element.readElementText();
QLineEdit *value = w->findChild<QLineEdit *>(QStringLiteral("value"));
value->setText(tagValue);
#ifdef QDOMELEMENT_FIXME
node = node.nextSibling();
QDomElement variableElement = node.toElement();
if (!variableElement.isNull()) {
const QString variableTagName = variableElement.tagName();
if (element.readNextStartElement()) {
const QStringRef variableTagName = element.name();
if (variableTagName == QLatin1String("str")) {
QLineEdit *variable = w->findChild<QLineEdit *>(QStringLiteral("variable"));
variable->setText(AutoCreateScriptUtil::protectSlash(variableElement.text()));
variable->setText(AutoCreateScriptUtil::protectSlash(element.readElementText()));
}
} else {
return false;
}
#endif
} else if (tagName == QLatin1String("tag")) {
const QString tagValue = element.readElementText();
if (tagValue == QLatin1String("quoteregex")) {
......@@ -116,6 +112,7 @@ bool SieveActionSetVariable::setParamWidgetValue(QXmlStreamReader &element, QWid
modifier->setCode(AutoCreateScriptUtil::tagValue(tagValue), name(), error);
}
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
//implement in the future ?
......
......@@ -127,6 +127,7 @@ bool SieveActionVacation::setParamWidgetValue(QXmlStreamReader &element, QWidget
QLineEdit *addresses = w->findChild<QLineEdit *>(QStringLiteral("addresses"));
addresses->setText(AutoCreateScriptUtil::listValueToStr(element));
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
//implement in the future ?
......
......@@ -261,6 +261,7 @@ void SieveActionWidget::updateAddRemoveButton(bool addButtonEnabled, bool remove
bool SieveActionWidget::setAction(const QString &actionName, QXmlStreamReader &element, const QString &comment, QString &error)
{
qDebug() << "bool SieveActionWidget::setAction(const QString &actionName, QXmlStreamReader &element, const QString &comment, QString &error)" << actionName;
const int index = mComboBox->findData(actionName);
bool result = false;
if (index != -1) {
......@@ -365,6 +366,7 @@ int SieveActionWidgetLister::actionNumber() const
void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyActions, QString &error)
{
qDebug() <<" void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyActions, QString &error) onlyaction" << onlyActions;
QString comment;
if (onlyActions) {
const QStringRef tagName = element.name();
......@@ -379,6 +381,7 @@ void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyAct
w->setAction(actionName, element, comment, error);
//comment.clear();
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else {
qCDebug(LIBKSIEVE_LOG) << " SieveActionWidgetLister::loadScript don't have name attribute " << tagName;
......@@ -391,9 +394,11 @@ void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyAct
bool previousActionWasAComment = false;
while (element.readNextStartElement()) {
const QStringRef tagName = element.name();
qDebug() << "ieveActionWidgetLister::loadScript SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSs" << tagName;
if (tagName == QLatin1String("action") || tagName == QLatin1String("control") /*for break action*/) {
if (element.attributes().hasAttribute(QStringLiteral("name"))) {
const QString actionName = element.attributes().value(QStringLiteral("name")).toString();
qDebug() << "************************************* actionName"<<actionName;
if (tagName == QLatin1String("control") && actionName == QLatin1String("if")) {
qCDebug(LIBKSIEVE_LOG) << "We found an loop if in a loop if. Not supported";
error += i18n("We detected a loop if in a loop if. It's not supported") + QLatin1Char('\n');
......@@ -421,6 +426,7 @@ void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyAct
if (previousActionWasAComment) {
comment += QLatin1Char('\n');
}
element.skipCurrentElement();
} else {
qCDebug(LIBKSIEVE_LOG) << " SieveActionWidgetLister::loadScript unknown tagName " << tagName;
}
......
......@@ -144,6 +144,7 @@ bool SieveConditionAddress::setParamWidgetValue(QXmlStreamReader &element, QWidg
}
++indexStr;
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -125,6 +125,7 @@ bool SieveConditionBody::setParamWidgetValue(QXmlStreamReader &element, QWidget
strValue << element.readElementText();
++indexStr;
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -128,6 +128,7 @@ bool SieveConditionConvert::setParamWidgetValue(QXmlStreamReader &element, QWidg
SelectConvertParameterWidget *params = w->findChild<SelectConvertParameterWidget *>(QStringLiteral("params"));
params->setCode(AutoCreateScriptUtil::listValue(element), error);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -112,6 +112,7 @@ bool SieveConditionCurrentDate::setParamWidgetValue(QXmlStreamReader &element, Q
SelectMatchTypeComboBox *selectMatchCombobox = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtype"));
selectMatchCombobox->setCode(AutoCreateScriptUtil::tagValueWithCondition(element.readElementText(), notCondition), name(), error);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -106,6 +106,7 @@ QString SieveConditionDate::help() const
bool SieveConditionDate::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, bool notCondition, QString &error)
{
qDebug() << " bool SieveConditionDate::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, bool notCondition, QString &error)";
int index = 0;
QString type;
QString value;
......@@ -113,29 +114,31 @@ bool SieveConditionDate::setParamWidgetValue(QXmlStreamReader &element, QWidget
QString commentStr;
while (element.readNextStartElement()) {
const QStringRef tagName = element.name();
if (tagName == QLatin1String("str")) {
if (index == 0) {
headerStr = element.readElementText();
} else if (index == 1) {
type = element.readElementText();
} else if (index == 2) {
value = element.readElementText();
} else {
tooManyArgument(tagName, index, 3, error);
qCDebug(LIBKSIEVE_LOG) << " SieveConditionDate::setParamWidgetValue too many argument :" << index;
}
++index;
} else if (tagName == QLatin1String("tag")) {
SelectMatchTypeComboBox *selectMatchCombobox = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtype"));
selectMatchCombobox->setCode(AutoCreateScriptUtil::tagValueWithCondition(element.readElementText(), notCondition), name(), error);
} else if (tagName == QLatin1String("crlf")) {
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
qDebug() << " tagName "<< tagName;
if (tagName == QLatin1String("str")) {
if (index == 0) {
headerStr = element.readElementText();
} else if (index == 1) {
type = element.readElementText();
} else if (index == 2) {
value = element.readElementText();
} else {
unknownTag(tagName, error);
qCDebug(LIBKSIEVE_LOG) << "SieveConditionDate::setParamWidgetValue unknown tag " << tagName;
tooManyArgument(tagName, index, 3, error);
qCDebug(LIBKSIEVE_LOG) << " SieveConditionDate::setParamWidgetValue too many argument :" << index;
}
++index;
} else if (tagName == QLatin1String("tag")) {
SelectMatchTypeComboBox *selectMatchCombobox = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtype"));
selectMatchCombobox->setCode(AutoCreateScriptUtil::tagValueWithCondition(element.readElementText(), notCondition), name(), error);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
} else {
unknownTag(tagName, error);
qCDebug(LIBKSIEVE_LOG) << "SieveConditionDate::setParamWidgetValue unknown tag " << tagName;
}
}
if (!commentStr.isEmpty()) {
setComment(commentStr);
......
......@@ -168,6 +168,7 @@ bool SieveConditionEnvelope::setParamWidgetValue(QXmlStreamReader &element, QWid
}
++indexStr;
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -124,6 +124,7 @@ bool SieveConditionEnvironment::setParamWidgetValue(QXmlStreamReader &element, Q
}
++index;
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -91,6 +91,7 @@ bool SieveConditionExists::setParamWidgetValue(QXmlStreamReader &element, QWidge
SelectHeaderTypeComboBox *selectHeaderType = w->findChild<SelectHeaderTypeComboBox *>(QStringLiteral("headervalue"));
selectHeaderType->setCode(AutoCreateScriptUtil::listValueToStr(element));
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -64,6 +64,7 @@ bool SieveConditionFalse::setParamWidgetValue(QXmlStreamReader &element, QWidget
if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else {
unknownTag(tagName, error);
......
......@@ -150,6 +150,7 @@ bool SieveConditionHasFlag::setParamWidgetValue(QXmlStreamReader &element, QWidg
} else if (tagName == QLatin1String("str")) {
strList << element.readElementText();
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -132,6 +132,7 @@ bool SieveConditionHeader::setParamWidgetValue(QXmlStreamReader &element, QWidge
}
++index;
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -89,6 +89,7 @@ bool SieveConditionIhave::setParamWidgetValue(QXmlStreamReader &element, QWidget
QLineEdit *edit = w->findChild<QLineEdit *>(QStringLiteral("edit"));
edit->setText(tagValue);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -87,6 +87,7 @@ bool SieveConditionMailboxExists::setParamWidgetValue(QXmlStreamReader &element,
QLineEdit *edit = w->findChild<QLineEdit *>(QStringLiteral("edit"));
edit->setText(AutoCreateScriptUtil::quoteStr(tagValue));
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -163,6 +163,7 @@ bool SieveConditionMetaData::setParamWidgetValue(QXmlStreamReader &element, QWid
SelectMatchTypeComboBox *selectType = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("selecttype"));
selectType->setCode(AutoCreateScriptUtil::tagValueWithCondition(element.readElementText(), notCondition), name(), error);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -109,6 +109,7 @@ bool SieveConditionMetaDataExists::setParamWidgetValue(QXmlStreamReader &element
}
++index;
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -164,6 +164,7 @@ bool SieveConditionServerMetaData::setParamWidgetValue(QXmlStreamReader &element
SelectMatchTypeComboBox *selectType = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("selecttype"));
selectType->setCode(AutoCreateScriptUtil::tagValueWithCondition(element.readElementText(), notCondition), name(), error);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -88,6 +88,7 @@ bool SieveConditionServerMetaDataExists::setParamWidgetValue(QXmlStreamReader &e
QLineEdit *value = w->findChild<QLineEdit *>(QStringLiteral("value"));
value->setText(tagValue);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -82,14 +82,15 @@ bool SieveConditionSize::setParamWidgetValue(QXmlStreamReader &element, QWidget
combo->setCurrentIndex(index);
}
} else if (tagName == QLatin1String("num")) {
const qlonglong tagValue = element.readElementText().toLongLong();
QString numIdentifier;
if (element.attributes().hasAttribute(QStringLiteral("quantifier"))) {
numIdentifier = element.attributes().value(QStringLiteral("quantifier")).toString();
}
const qlonglong tagValue = element.readElementText().toLongLong();
SelectSizeWidget *sizeWidget = w->findChild<SelectSizeWidget *>(QStringLiteral("sizewidget"));
sizeWidget->setCode(tagValue, numIdentifier, name(), error);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -130,31 +130,19 @@ bool SieveConditionSpamTest::setParamWidgetValue(QXmlStreamReader &element, QWid
if (tagName == QLatin1String("tag")) {
const QString tagValue = element.readElementText();
if (tagValue == QLatin1String("count") || tagValue == QLatin1String("value")) {
#ifdef QDOMELEMENT_FIXME
node = node.nextSibling();
if (!node.isNull()) {
QDomElement relationalElement = node.toElement();
if (!relationalElement.isNull()) {
if (relationalElement.tagName() == QLatin1String("str")) {
SelectRelationalMatchType *relation = w->findChild<SelectRelationalMatchType *>(QStringLiteral("relation"));
relation->setCode(AutoCreateScriptUtil::tagValue(tagValue), relationalElement.text(), name(), error);
}
if (element.readNextStartElement()) {
if (element.name() == QLatin1String("str")) {
SelectRelationalMatchType *relation = w->findChild<SelectRelationalMatchType *>(QStringLiteral("relation"));
relation->setCode(AutoCreateScriptUtil::tagValue(tagValue), element.readElementText(), name(), error);
}
}
#endif
} else if (tagValue == QLatin1String("comparator")) {
#ifdef QDOMELEMENT_FIXME
node = node.nextSibling();
if (!node.isNull()) {
QDomElement comparatorElement = node.toElement();
if (!comparatorElement.isNull()) {
if (comparatorElement.tagName() == QLatin1String("str")) {
SelectComparatorComboBox *comparator = w->findChild<SelectComparatorComboBox *>(QStringLiteral("comparator"));
comparator->setCode(comparatorElement.text(), name(), error);
}
if (element.readNextStartElement()) {
if (element.name() == QLatin1String("str")) {
SelectComparatorComboBox *comparator = w->findChild<SelectComparatorComboBox *>(QStringLiteral("comparator"));
comparator->setCode(element.readElementText(), name(), error);
}
}
#endif
} else if (tagValue == QLatin1String("percent")) {
if (mHasSpamTestPlusSupport) {
QCheckBox *checkbox = w->findChild<QCheckBox *>(QStringLiteral("percent"));
......@@ -171,6 +159,7 @@ bool SieveConditionSpamTest::setParamWidgetValue(QXmlStreamReader &element, QWid
QSpinBox *spinbox = w->findChild<QSpinBox *>(QStringLiteral("value"));
spinbox->setValue(element.readElementText().toInt());
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
......
......@@ -64,6 +64,7 @@ bool SieveConditionTrue::setParamWidgetValue(QXmlStreamReader &element, QWidget
if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
} else {
unknownTag(tagName, error);
......
......@@ -111,38 +111,29 @@ bool SieveConditionVirusTest::setParamWidgetValue(QXmlStreamReader &element, QWi
if (tagName == QLatin1String("tag")) {
const QString tagValue = element.readElementText();
#ifdef QDOMELEMENT_FIXME
if (tagValue == QLatin1String("count") || tagValue == QLatin1String("value")) {
node = node.nextSibling();
</