Commit c5f97741 authored by Laurent Montel's avatar Laurent Montel 😁

Add defaultDomain

parent e470a898
......@@ -40,6 +40,7 @@ void PluginEditorCheckBeforeSendParamsTest::shouldHaveDefaultValues()
QCOMPARE(params.identity(), (uint) - 1);
QVERIFY(!params.isHtmlMail());
QVERIFY(params.addresses().isEmpty());
QVERIFY(params.defaultDomain().isEmpty());
}
......@@ -49,17 +50,20 @@ void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual()
const QString subject(QStringLiteral("foo"));
const QString plainText(QStringLiteral("bla"));
const QStringList lst{ QStringLiteral("foo"), QStringLiteral("foo"), QStringLiteral("foo")};
const QString defaultDomain(QStringLiteral("bli"));
bool isHmlMail = true;
params1.setSubject(subject);
params1.setHtmlMail(isHmlMail);
params1.setPlainText(plainText);
params1.setAddresses(lst);
params1.setDefaultDomain(defaultDomain);
MessageComposer::PluginEditorCheckBeforeSendParams params2 = params1;
QVERIFY(params2 == params1);
QCOMPARE(params2.isHtmlMail(), isHmlMail);
QCOMPARE(params2.subject(), subject);
QCOMPARE(params2.plainText(), plainText);
QCOMPARE(params2.addresses(), lst);
QCOMPARE(params2.defaultDomain(), defaultDomain);
}
void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue()
......@@ -67,6 +71,7 @@ void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue()
MessageComposer::PluginEditorCheckBeforeSendParams params1;
const QString subject(QStringLiteral("foo"));
const QString plainText(QStringLiteral("bla"));
const QString defaultDomain(QStringLiteral("bli"));
bool isHmlMail = true;
uint identity = 5;
const QStringList lst{ QStringLiteral("foo"), QStringLiteral("foo"), QStringLiteral("foo")};
......@@ -75,11 +80,13 @@ void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue()
params1.setPlainText(plainText);
params1.setIdentity(identity);
params1.setAddresses(lst);
params1.setDefaultDomain(defaultDomain);
QCOMPARE(params1.isHtmlMail(), isHmlMail);
QCOMPARE(params1.subject(), subject);
QCOMPARE(params1.identity(), identity);
QCOMPARE(params1.plainText(), plainText);
QCOMPARE(params1.addresses(), lst);
QCOMPARE(params1.defaultDomain(), defaultDomain);
}
QTEST_MAIN(PluginEditorCheckBeforeSendParamsTest)
......@@ -35,6 +35,7 @@ public:
QStringList listAddress;
QString plainText;
QString subject;
QString defaultDomain;
uint identity;
bool isHtml;
};
......@@ -64,6 +65,7 @@ PluginEditorCheckBeforeSendParams &PluginEditorCheckBeforeSendParams::operator=(
d->isHtml = other.isHtmlMail();
d->plainText = other.plainText();
d->listAddress = other.addresses();
d->defaultDomain = other.defaultDomain();
}
return *this;
}
......@@ -74,7 +76,8 @@ bool PluginEditorCheckBeforeSendParams::operator ==(const PluginEditorCheckBefor
(d->identity == other.identity()) &&
(d->isHtml == other.isHtmlMail()) &&
(d->plainText == other.plainText()) &&
(d->listAddress == other.addresses());
(d->listAddress == other.addresses()) &&
(d->defaultDomain == other.defaultDomain());
}
void PluginEditorCheckBeforeSendParams::setSubject(const QString &subject)
......@@ -126,3 +129,13 @@ QStringList PluginEditorCheckBeforeSendParams::addresses() const
{
return d->listAddress;
}
void PluginEditorCheckBeforeSendParams::setDefaultDomain(const QString &domain)
{
d->defaultDomain = domain;
}
QString PluginEditorCheckBeforeSendParams::defaultDomain() const
{
return d->defaultDomain;
}
......@@ -48,6 +48,9 @@ public:
void setAddresses(const QStringList &lst);
QStringList addresses() const;
void setDefaultDomain(const QString &domain);
QString defaultDomain() 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