Commit 0a5bf45a authored by Laurent Montel's avatar Laurent Montel 😁

Allow to add list of address

parent f5a10b24
......@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(PIM_VERSION "5.2.77")
set(PIM_VERSION "5.2.78")
set(MESSAGELIB_LIB_VERSION ${PIM_VERSION})
set(KDEPIMLIBS_LIB_VERSION "5.2.40")
......
......@@ -39,6 +39,8 @@ void PluginEditorCheckBeforeSendParamsTest::shouldHaveDefaultValues()
QVERIFY(params.plainText().isEmpty());
QCOMPARE(params.identity(), (uint)-1);
QVERIFY(!params.isHtmlMail());
QVERIFY(params.addresses().isEmpty());
}
void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual()
......@@ -46,15 +48,18 @@ void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual()
MessageComposer::PluginEditorCheckBeforeSendParams params1;
const QString subject(QStringLiteral("foo"));
const QString plainText(QStringLiteral("bla"));
const QStringList lst{ QStringLiteral("foo"), QStringLiteral("foo"), QStringLiteral("foo")};
bool isHmlMail = true;
params1.setSubject(subject);
params1.setHtmlMail(isHmlMail);
params1.setPlainText(plainText);
params1.setAddresses(lst);
MessageComposer::PluginEditorCheckBeforeSendParams params2 = params1;
QVERIFY(params2 == params1);
QCOMPARE(params2.isHtmlMail(), isHmlMail);
QCOMPARE(params2.subject(), subject);
QCOMPARE(params2.plainText(), plainText);
QCOMPARE(params2.addresses(), lst);
}
void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue()
......@@ -64,14 +69,17 @@ void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue()
const QString plainText(QStringLiteral("bla"));
bool isHmlMail = true;
uint identity = 5;
const QStringList lst{ QStringLiteral("foo"), QStringLiteral("foo"), QStringLiteral("foo")};
params1.setSubject(subject);
params1.setHtmlMail(isHmlMail);
params1.setPlainText(plainText);
params1.setIdentity(identity);
params1.setAddresses(lst);
QCOMPARE(params1.isHtmlMail(), isHmlMail);
QCOMPARE(params1.subject(), subject);
QCOMPARE(params1.identity(), identity);
QCOMPARE(params1.plainText(), plainText);
QCOMPARE(params1.addresses(), lst);
}
QTEST_MAIN(PluginEditorCheckBeforeSendParamsTest)
......@@ -19,6 +19,8 @@
#include "plugineditorcheckbeforesendparams.h"
#include <QStringList>
using namespace MessageComposer;
class MessageComposer::PluginEditorCheckBeforeSendParamsPrivate
......@@ -30,6 +32,7 @@ public:
{
}
QStringList listAddress;
QString plainText;
QString subject;
uint identity;
......@@ -61,6 +64,7 @@ PluginEditorCheckBeforeSendParams &PluginEditorCheckBeforeSendParams::operator=(
d->identity = other.identity();
d->isHtml = other.isHtmlMail();
d->plainText = other.plainText();
d->listAddress = other.addresses();
}
return *this;
}
......@@ -69,8 +73,9 @@ bool PluginEditorCheckBeforeSendParams::operator ==(const PluginEditorCheckBefor
{
return (d->subject == other.subject()) &&
(d->identity == other.identity()) &&
(d->isHtml == other.isHtmlMail() &&
(d->plainText == other.plainText()));
(d->isHtml == other.isHtmlMail()) &&
(d->plainText == other.plainText()) &&
(d->listAddress == other.addresses());
}
void PluginEditorCheckBeforeSendParams::setSubject(const QString &subject)
......@@ -112,3 +117,13 @@ QString PluginEditorCheckBeforeSendParams::plainText() const
{
return d->plainText;
}
void PluginEditorCheckBeforeSendParams::setAddresses(const QStringList &lst)
{
d->listAddress = lst;
}
QStringList PluginEditorCheckBeforeSendParams::addresses() const
{
return d->listAddress;
}
......@@ -45,6 +45,9 @@ public:
void setPlainText(const QString &text);
QString plainText() const;
void setAddresses(const QStringList &lst);
QStringList addresses() 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