Commit 30df4111 authored by Laurent Montel's avatar Laurent Montel 😁

coding style

parent 57f05b7c
...@@ -124,7 +124,7 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data() ...@@ -124,7 +124,7 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data()
#if 1 #if 1
QTest::newRow("test-foreach") << QStringLiteral("test-foreach") << false << true; QTest::newRow("test-foreach") << QStringLiteral("test-foreach") << false << true;
QTest::newRow("not-condition") << QStringLiteral("not-condition") << false << true; QTest::newRow("not-condition") << QStringLiteral("not-condition") << false << true;
QTest::newRow("test-envelop-without-part") << QStringLiteral("test-envelop-without-part") << false << true; QTest::newRow("test-envelop-without-part") << QStringLiteral("test-envelop-without-part") << false << true;
QTest::newRow("include") << QStringLiteral("include") << false << true; QTest::newRow("include") << QStringLiteral("include") << false << true;
QTest::newRow("notify") << QStringLiteral("notify") << false << true; QTest::newRow("notify") << QStringLiteral("notify") << false << true;
......
...@@ -383,7 +383,6 @@ void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyAct ...@@ -383,7 +383,6 @@ void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyAct
//nothing //nothing
} else { } else {
qCDebug(LIBKSIEVE_LOG) << " SieveActionWidgetLister::loadScript don't have name attribute " << tagName; qCDebug(LIBKSIEVE_LOG) << " SieveActionWidgetLister::loadScript don't have name attribute " << tagName;
} }
} else { } else {
qCDebug(LIBKSIEVE_LOG) << " SieveActionWidgetLister::loadScript Unknow tag name " << tagName; qCDebug(LIBKSIEVE_LOG) << " SieveActionWidgetLister::loadScript Unknow tag name " << tagName;
...@@ -429,5 +428,4 @@ void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyAct ...@@ -429,5 +428,4 @@ void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyAct
} }
} }
} }
} }
...@@ -105,7 +105,7 @@ QStringList SieveConditionAddress::needRequires(QWidget *w) const ...@@ -105,7 +105,7 @@ QStringList SieveConditionAddress::needRequires(QWidget *w) const
QString SieveConditionAddress::help() const QString SieveConditionAddress::help() const
{ {
return i18n( return i18n(
"The \"address\" test matches Internet addresses in structured headers that contain addresses. It returns true if any header contains any key in the specified part of the address, as modified by the comparator and the match keyword."); "The \"address\" test matches Internet addresses in structured headers that contain addresses. It returns true if any header contains any key in the specified part of the address, as modified by the comparator and the match keyword.");
} }
bool SieveConditionAddress::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, bool notCondition, QString &error) bool SieveConditionAddress::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, bool notCondition, QString &error)
......
...@@ -96,7 +96,7 @@ QString SieveConditionBody::serverNeedsCapability() const ...@@ -96,7 +96,7 @@ QString SieveConditionBody::serverNeedsCapability() const
QString SieveConditionBody::help() const QString SieveConditionBody::help() const
{ {
return i18n( return i18n(
"The body test matches content in the body of an email message, that is, anything following the first empty line after the header. (The empty line itself, if present, is not considered to be part of the body.)"); "The body test matches content in the body of an email message, that is, anything following the first empty line after the header. (The empty line itself, if present, is not considered to be part of the body.)");
} }
bool SieveConditionBody::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, bool notCondition, QString &error) bool SieveConditionBody::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, bool notCondition, QString &error)
......
...@@ -82,7 +82,7 @@ QString SieveConditionHeader::code(QWidget *w) const ...@@ -82,7 +82,7 @@ QString SieveConditionHeader::code(QWidget *w) const
valueStr = AutoCreateScriptUtil::fixListValue(valueStr); valueStr = AutoCreateScriptUtil::fixListValue(valueStr);
return AutoCreateScriptUtil::negativeString(isNegative) + QStringLiteral("header %1 %2 %3").arg(matchString, headerStr, valueStr) return AutoCreateScriptUtil::negativeString(isNegative) + QStringLiteral("header %1 %2 %3").arg(matchString, headerStr, valueStr)
+ AutoCreateScriptUtil::generateConditionComment(comment()); + AutoCreateScriptUtil::generateConditionComment(comment());
} }
QString SieveConditionHeader::help() const QString SieveConditionHeader::help() const
......
...@@ -124,7 +124,7 @@ QString SieveConditionServerMetaData::serverNeedsCapability() const ...@@ -124,7 +124,7 @@ QString SieveConditionServerMetaData::serverNeedsCapability() const
QString SieveConditionServerMetaData::help() const QString SieveConditionServerMetaData::help() const
{ {
return i18n( return i18n(
"This test retrieves the value of the server annotation \"annotation-name\". The retrieved value is compared to the \"key-list\". The test returns true if the annotation exists and its value matches any of the keys."); "This test retrieves the value of the server annotation \"annotation-name\". The retrieved value is compared to the \"key-list\". The test returns true if the annotation exists and its value matches any of the keys.");
} }
bool SieveConditionServerMetaData::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, bool notCondition, QString &error) bool SieveConditionServerMetaData::setParamWidgetValue(QXmlStreamReader &element, QWidget *w, bool notCondition, QString &error)
......
...@@ -83,19 +83,19 @@ bool SieveConditionServerMetaDataExists::setParamWidgetValue(QXmlStreamReader &e ...@@ -83,19 +83,19 @@ bool SieveConditionServerMetaDataExists::setParamWidgetValue(QXmlStreamReader &e
QString commentStr; QString commentStr;
while (element.readNextStartElement()) { while (element.readNextStartElement()) {
const QStringRef tagName = element.name(); const QStringRef tagName = element.name();
if (tagName == QLatin1String("str")) { if (tagName == QLatin1String("str")) {
const QString tagValue = element.readElementText(); const QString tagValue = element.readElementText();
QLineEdit *value = w->findChild<QLineEdit *>(QStringLiteral("value")); QLineEdit *value = w->findChild<QLineEdit *>(QStringLiteral("value"));
value->setText(tagValue); value->setText(tagValue);
} else if (tagName == QLatin1String("crlf")) { } else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement(); element.skipCurrentElement();
//nothing //nothing
} else if (tagName == QLatin1String("comment")) { } else if (tagName == QLatin1String("comment")) {
commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText()); commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText());
} else { } else {
unknownTag(tagName, error); unknownTag(tagName, error);
qCDebug(LIBKSIEVE_LOG) << " SieveConditionServerMetaDataExists::setParamWidgetValue unknown tagName " << tagName; qCDebug(LIBKSIEVE_LOG) << " SieveConditionServerMetaDataExists::setParamWidgetValue unknown tagName " << tagName;
} }
} }
if (!commentStr.isEmpty()) { if (!commentStr.isEmpty()) {
setComment(commentStr); setComment(commentStr);
......
...@@ -406,5 +406,4 @@ void SieveConditionWidgetLister::loadScript(QXmlStreamReader &element, bool uniq ...@@ -406,5 +406,4 @@ void SieveConditionWidgetLister::loadScript(QXmlStreamReader &element, bool uniq
} }
} }
} }
} }
...@@ -307,18 +307,18 @@ bool SieveGlobalVariableLister::loadSetVariable(QXmlStreamReader &element, QStri ...@@ -307,18 +307,18 @@ bool SieveGlobalVariableLister::loadSetVariable(QXmlStreamReader &element, QStri
int index = 0; int index = 0;
while (element.readNextStartElement()) { while (element.readNextStartElement()) {
const QStringRef tagName = element.name(); const QStringRef tagName = element.name();
if (tagName == QLatin1String("str")) { if (tagName == QLatin1String("str")) {
if (index == 0) { if (index == 0) {
variableName = element.readElementText(); variableName = element.readElementText();
} else if (index == 1) { } else if (index == 1) {
variableValue = element.readElementText(); variableValue = element.readElementText();
} else {
qCDebug(LIBKSIEVE_LOG) << " SieveGlobalVariableLister::loadSetVariable too many argument:" << index;
}
++index;
} else { } else {
qCDebug(LIBKSIEVE_LOG) << " SieveGlobalVariableLister::loadSetVariable unknown tagName " << tagName; qCDebug(LIBKSIEVE_LOG) << " SieveGlobalVariableLister::loadSetVariable too many argument:" << index;
} }
++index;
} else {
qCDebug(LIBKSIEVE_LOG) << " SieveGlobalVariableLister::loadSetVariable unknown tagName " << tagName;
}
} }
const QList<QWidget *> lstWidget = widgets(); const QList<QWidget *> lstWidget = widgets();
...@@ -331,5 +331,4 @@ bool SieveGlobalVariableLister::loadSetVariable(QXmlStreamReader &element, QStri ...@@ -331,5 +331,4 @@ bool SieveGlobalVariableLister::loadSetVariable(QXmlStreamReader &element, QStri
} }
} }
return globalVariableFound; return globalVariableFound;
} }
...@@ -99,7 +99,7 @@ void SieveIncludeActionWidget::loadScript(QXmlStreamReader &element, QString &er ...@@ -99,7 +99,7 @@ void SieveIncludeActionWidget::loadScript(QXmlStreamReader &element, QString &er
if (tagName == QLatin1String("tag")) { if (tagName == QLatin1String("tag")) {
const QString tagValue = element.readElementText(); const QString tagValue = element.readElementText();
if (tagValue == QLatin1String("personal") if (tagValue == QLatin1String("personal")
|| tagValue == QLatin1String("global")) { || tagValue == QLatin1String("global")) {
mLocation->setCode(AutoCreateScriptUtil::tagValue(tagValue), error); mLocation->setCode(AutoCreateScriptUtil::tagValue(tagValue), error);
} else if (tagValue == QLatin1String("optional")) { } else if (tagValue == QLatin1String("optional")) {
mOptional->setChecked(true); mOptional->setChecked(true);
...@@ -114,7 +114,6 @@ void SieveIncludeActionWidget::loadScript(QXmlStreamReader &element, QString &er ...@@ -114,7 +114,6 @@ void SieveIncludeActionWidget::loadScript(QXmlStreamReader &element, QString &er
qCDebug(LIBKSIEVE_LOG) << " SieveIncludeActionWidget::loadScript unknown tagName " << tagName; qCDebug(LIBKSIEVE_LOG) << " SieveIncludeActionWidget::loadScript unknown tagName " << tagName;
} }
} }
} }
void SieveIncludeActionWidget::generatedScript(QString &script) void SieveIncludeActionWidget::generatedScript(QString &script)
......
...@@ -285,5 +285,4 @@ void SieveScriptBlockWidget::loadScript(QXmlStreamReader &element, bool onlyActi ...@@ -285,5 +285,4 @@ void SieveScriptBlockWidget::loadScript(QXmlStreamReader &element, bool onlyActi
} }
} }
} }
} }
...@@ -416,7 +416,7 @@ void SieveScriptListBox::loadBlock(QXmlStreamReader &n, SieveScriptPage *current ...@@ -416,7 +416,7 @@ void SieveScriptListBox::loadBlock(QXmlStreamReader &n, SieveScriptPage *current
currentPage = nullptr; currentPage = nullptr;
} }
if (n.attributes().hasAttribute(QStringLiteral("name"))) { if (n.attributes().hasAttribute(QStringLiteral("name"))) {
const QString controlType =n.attributes().value(QStringLiteral("name")).toString(); const QString controlType = n.attributes().value(QStringLiteral("name")).toString();
//qCDebug(LIBKSIEVE_LOG)<<" controlType"<<controlType; //qCDebug(LIBKSIEVE_LOG)<<" controlType"<<controlType;
if (controlType == QLatin1String("if")) { if (controlType == QLatin1String("if")) {
typeBlock = TypeBlockIf; typeBlock = TypeBlockIf;
......
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