Commit a8687a75 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix Bug 383756 - Kontact/KMail crashes when trying to edit Sieve scripts in "Simple Mode"

FIXED-IN: 5.6.1
BUG: 383756
parent 690384ee
...@@ -234,6 +234,8 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data() ...@@ -234,6 +234,8 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data()
QTest::newRow("wierd-script") << QStringLiteral("wierd-script") << false << true; QTest::newRow("wierd-script") << QStringLiteral("wierd-script") << false << true;
QTest::newRow("test-text-with-backslash") << QStringLiteral("test-text-with-backslash") << false << true; QTest::newRow("test-text-with-backslash") << QStringLiteral("test-text-with-backslash") << false << true;
//Bug 383756
QTest::newRow("body-without-bodytype") << QStringLiteral("body-without-bodytype") << false << true;
} }
QTEST_MAIN(SieveEditorGraphicalModeWidgetTest) QTEST_MAIN(SieveEditorGraphicalModeWidgetTest)
...@@ -150,9 +150,13 @@ bool SieveConditionBody::setParamWidgetValue(QXmlStreamReader &element, QWidget ...@@ -150,9 +150,13 @@ bool SieveConditionBody::setParamWidgetValue(QXmlStreamReader &element, QWidget
matchType->setCode(tagValueList.at(1), name(), error); matchType->setCode(tagValueList.at(1), name(), error);
} else { } else {
SelectMatchTypeComboBox *matchType = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtype")); SelectMatchTypeComboBox *matchType = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtype"));
if (tagValueList.count() == 1) {
matchType->setCode(tagValueList.at(0), name(), error);
} else if (tagValueList.count() == 2) {
matchType->setCode(tagValueList.at(0), name(), error); matchType->setCode(tagValueList.at(0), name(), error);
bodyType->setCode(tagValueList.at(1), QString(), name(), errorStr); bodyType->setCode(tagValueList.at(1), QString(), name(), errorStr);
} }
}
AbstractRegexpEditorLineEdit *edit = w->findChild<AbstractRegexpEditorLineEdit *>(QStringLiteral("edit")); AbstractRegexpEditorLineEdit *edit = w->findChild<AbstractRegexpEditorLineEdit *>(QStringLiteral("edit"));
edit->setCode(wasListElement ? strValue.at(0) : AutoCreateScriptUtil::quoteStr(strValue.at(0))); edit->setCode(wasListElement ? strValue.at(0) : AutoCreateScriptUtil::quoteStr(strValue.at(0)));
} else if (strValue.count() == 2) { } else if (strValue.count() == 2) {
......
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