Commit 71b2b02d authored by Laurent Montel's avatar Laurent Montel 😁

Allow to use plaintext

parent 6712a630
......@@ -36,6 +36,7 @@ void PluginEditorCheckBeforeSendParamsTest::shouldHaveDefaultValues()
{
MessageComposer::PluginEditorCheckBeforeSendParams params;
QVERIFY(params.subject().isEmpty());
QVERIFY(params.plainText().isEmpty());
QCOMPARE(params.identity(), (uint)-1);
QVERIFY(!params.isHtmlMail());
}
......@@ -44,27 +45,33 @@ void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual()
{
MessageComposer::PluginEditorCheckBeforeSendParams params1;
const QString subject(QStringLiteral("foo"));
const QString plainText(QStringLiteral("bla"));
bool isHmlMail = true;
params1.setSubject(subject);
params1.setHtmlMail(isHmlMail);
params1.setPlainText(plainText);
MessageComposer::PluginEditorCheckBeforeSendParams params2 = params1;
QVERIFY(params2 == params1);
QCOMPARE(params2.isHtmlMail(), isHmlMail);
QCOMPARE(params2.subject(), subject);
QCOMPARE(params2.plainText(), plainText);
}
void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue()
{
MessageComposer::PluginEditorCheckBeforeSendParams params1;
const QString subject(QStringLiteral("foo"));
const QString plainText(QStringLiteral("bla"));
bool isHmlMail = true;
uint identity = 5;
params1.setSubject(subject);
params1.setHtmlMail(isHmlMail);
params1.setPlainText(plainText);
params1.setIdentity(identity);
QCOMPARE(params1.isHtmlMail(), isHmlMail);
QCOMPARE(params1.subject(), subject);
QCOMPARE(params1.identity(), identity);
QCOMPARE(params1.plainText(), plainText);
}
QTEST_MAIN(PluginEditorCheckBeforeSendParamsTest)
......@@ -30,6 +30,7 @@ public:
{
}
QString plainText;
QString subject;
uint identity;
bool isHtml;
......@@ -59,6 +60,7 @@ PluginEditorCheckBeforeSendParams &PluginEditorCheckBeforeSendParams::operator=(
d->subject = other.subject();
d->identity = other.identity();
d->isHtml = other.isHtmlMail();
d->plainText = other.plainText();
}
return *this;
}
......@@ -66,8 +68,9 @@ PluginEditorCheckBeforeSendParams &PluginEditorCheckBeforeSendParams::operator=(
bool PluginEditorCheckBeforeSendParams::operator ==(const PluginEditorCheckBeforeSendParams &other) const
{
return (d->subject == other.subject()) &&
(d->identity = other.identity()) &&
(d->isHtml = other.isHtmlMail());
(d->identity == other.identity()) &&
(d->isHtml == other.isHtmlMail() &&
(d->plainText == other.plainText()));
}
void PluginEditorCheckBeforeSendParams::setSubject(const QString &subject)
......@@ -99,3 +102,13 @@ void PluginEditorCheckBeforeSendParams::setHtmlMail(bool html)
{
d->isHtml = html;
}
void PluginEditorCheckBeforeSendParams::setPlainText(const QString &text)
{
d->plainText = text;
}
QString PluginEditorCheckBeforeSendParams::plainText() const
{
return d->plainText;
}
......@@ -42,6 +42,9 @@ public:
bool isHtmlMail() const;
void setHtmlMail(bool html);
void setPlainText(const QString &text);
QString plainText() const;
PluginEditorCheckBeforeSendParams &operator =(const PluginEditorCheckBeforeSendParams &other);
bool operator ==(const PluginEditorCheckBeforeSendParams &other) const;
private:
......
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