summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-07-10 23:18:00 +0200
committerMontel Laurent <[email protected]>2017-07-10 23:18:00 +0200
commita32b3dcd6f47c02edfb6810ea3305ee487025cc7 (patch)
tree5f540eee5fd0d9d2a5eb409ebe2e9d86063b1c8d
parent7c111188b2d3bafe3f097f7dd57415cb5146279b (diff)
Fix more bug. Add autotest for it
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/test-text-with-backslash-ref.siv9
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/test-text-with-backslash.siv7
-rw-r--r--src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp2
-rw-r--r--src/ksieveui/autocreatescripts/sieveactions/sieveactionereject.cpp2
-rw-r--r--src/ksieveui/autocreatescripts/sieveactions/sieveactionreject.cpp2
-rw-r--r--src/ksieveui/scriptsparsing/autotests/xmlprintingscriptbuildertest.cpp1
6 files changed, 20 insertions, 3 deletions
diff --git a/src/ksieveui/autocreatescripts/autotests/data/test-text-with-backslash-ref.siv b/src/ksieveui/autocreatescripts/autotests/data/test-text-with-backslash-ref.siv
new file mode 100644
index 0000000..4ecc30c
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/test-text-with-backslash-ref.siv
@@ -0,0 +1,9 @@
+require "reject";
+
+#SCRIPTNAME: test
+reject text:
+test \"too\"
+.
+;
+
+
diff --git a/src/ksieveui/autocreatescripts/autotests/data/test-text-with-backslash.siv b/src/ksieveui/autocreatescripts/autotests/data/test-text-with-backslash.siv
new file mode 100644
index 0000000..5eb5708
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/test-text-with-backslash.siv
@@ -0,0 +1,7 @@
+require "reject";
+
+#SCRIPTNAME: test
+reject text:
+test \"too\"
+.
+;
diff --git a/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp b/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
index ce9a891..e1d2da7 100644
--- a/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
+++ b/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
@@ -232,6 +232,8 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data()
QTest::newRow("test-header-multilist-comment") << QStringLiteral("test-header-multilist-comment") << 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_MAIN(SieveEditorGraphicalModeWidgetTest)
diff --git a/src/ksieveui/autocreatescripts/sieveactions/sieveactionereject.cpp b/src/ksieveui/autocreatescripts/sieveactions/sieveactionereject.cpp
index 5128a12..2c92267 100644
--- a/src/ksieveui/autocreatescripts/sieveactions/sieveactionereject.cpp
+++ b/src/ksieveui/autocreatescripts/sieveactions/sieveactionereject.cpp
@@ -57,7 +57,7 @@ bool SieveActionEReject::setParamWidgetValue(QXmlStreamReader &element, QWidget
if (tagName == QLatin1String("str")) {
const QString tagValue = element.readElementText();
MultiLineEdit *edit = w->findChild<MultiLineEdit *>(QStringLiteral("rejectmessage"));
- edit->setPlainText(AutoCreateScriptUtil::quoteStr(tagValue));
+ edit->setPlainText(tagValue);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
diff --git a/src/ksieveui/autocreatescripts/sieveactions/sieveactionreject.cpp b/src/ksieveui/autocreatescripts/sieveactions/sieveactionreject.cpp
index 49c91ac..96deaa5 100644
--- a/src/ksieveui/autocreatescripts/sieveactions/sieveactionreject.cpp
+++ b/src/ksieveui/autocreatescripts/sieveactions/sieveactionreject.cpp
@@ -57,7 +57,7 @@ bool SieveActionReject::setParamWidgetValue(QXmlStreamReader &element, QWidget *
if (tagName == QLatin1String("str")) {
const QString tagValue = element.readElementText();
MultiLineEdit *edit = w->findChild<MultiLineEdit *>(QStringLiteral("rejectmessage"));
- edit->setPlainText(AutoCreateScriptUtil::quoteStr(tagValue));
+ edit->setPlainText(tagValue);
} else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement();
//nothing
diff --git a/src/ksieveui/scriptsparsing/autotests/xmlprintingscriptbuildertest.cpp b/src/ksieveui/scriptsparsing/autotests/xmlprintingscriptbuildertest.cpp
index 8e7a4c7..d1ed645 100644
--- a/src/ksieveui/scriptsparsing/autotests/xmlprintingscriptbuildertest.cpp
+++ b/src/ksieveui/scriptsparsing/autotests/xmlprintingscriptbuildertest.cpp
@@ -128,7 +128,6 @@ void XMLPrintingScriptBuilderTest::shouldCreateXml_data()
QTest::newRow("test-comment8") << QStringLiteral("test-comment8")<< true;
QTest::newRow("test-comment9") << QStringLiteral("test-comment9")<< true;
QTest::newRow("test-date1") << QStringLiteral("test-date1")<< true;
-
}
void XMLPrintingScriptBuilderTest::shouldCreateXml()