Commit 4571cb10 authored by Laurent Montel's avatar Laurent Montel 😁

Add info about attachment

parent 3900571c
...@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) ...@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory) include(ECMQtDeclareLoggingCategory)
include(ECMAddTests) include(ECMAddTests)
set(PIM_VERSION "5.2.80") set(PIM_VERSION "5.2.81")
set(MESSAGELIB_LIB_VERSION ${PIM_VERSION}) set(MESSAGELIB_LIB_VERSION ${PIM_VERSION})
set(KDEPIMLIBS_LIB_VERSION "5.2.40") set(KDEPIMLIBS_LIB_VERSION "5.2.40")
......
...@@ -41,7 +41,7 @@ void PluginEditorCheckBeforeSendParamsTest::shouldHaveDefaultValues() ...@@ -41,7 +41,7 @@ void PluginEditorCheckBeforeSendParamsTest::shouldHaveDefaultValues()
QVERIFY(!params.isHtmlMail()); QVERIFY(!params.isHtmlMail());
QVERIFY(params.addresses().isEmpty()); QVERIFY(params.addresses().isEmpty());
QVERIFY(params.defaultDomain().isEmpty()); QVERIFY(params.defaultDomain().isEmpty());
QVERIFY(!params.hasAttachment());
} }
void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual() void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual()
...@@ -52,11 +52,13 @@ void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual() ...@@ -52,11 +52,13 @@ void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual()
const QStringList lst{ QStringLiteral("foo"), QStringLiteral("foo"), QStringLiteral("foo")}; const QStringList lst{ QStringLiteral("foo"), QStringLiteral("foo"), QStringLiteral("foo")};
const QString defaultDomain(QStringLiteral("bli")); const QString defaultDomain(QStringLiteral("bli"));
bool isHmlMail = true; bool isHmlMail = true;
bool hasAttachment = true;
params1.setSubject(subject); params1.setSubject(subject);
params1.setHtmlMail(isHmlMail); params1.setHtmlMail(isHmlMail);
params1.setPlainText(plainText); params1.setPlainText(plainText);
params1.setAddresses(lst); params1.setAddresses(lst);
params1.setDefaultDomain(defaultDomain); params1.setDefaultDomain(defaultDomain);
params1.setHasAttachment(hasAttachment);
MessageComposer::PluginEditorCheckBeforeSendParams params2 = params1; MessageComposer::PluginEditorCheckBeforeSendParams params2 = params1;
QVERIFY(params2 == params1); QVERIFY(params2 == params1);
QCOMPARE(params2.isHtmlMail(), isHmlMail); QCOMPARE(params2.isHtmlMail(), isHmlMail);
...@@ -64,6 +66,7 @@ void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual() ...@@ -64,6 +66,7 @@ void PluginEditorCheckBeforeSendParamsTest::shouldBeEqual()
QCOMPARE(params2.plainText(), plainText); QCOMPARE(params2.plainText(), plainText);
QCOMPARE(params2.addresses(), lst); QCOMPARE(params2.addresses(), lst);
QCOMPARE(params2.defaultDomain(), defaultDomain); QCOMPARE(params2.defaultDomain(), defaultDomain);
QCOMPARE(params2.hasAttachment(), hasAttachment);
} }
void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue() void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue()
...@@ -73,6 +76,7 @@ void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue() ...@@ -73,6 +76,7 @@ void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue()
const QString plainText(QStringLiteral("bla")); const QString plainText(QStringLiteral("bla"));
const QString defaultDomain(QStringLiteral("bli")); const QString defaultDomain(QStringLiteral("bli"));
bool isHmlMail = true; bool isHmlMail = true;
bool hasAttachment = true;
uint identity = 5; uint identity = 5;
const QStringList lst{ QStringLiteral("foo"), QStringLiteral("foo"), QStringLiteral("foo")}; const QStringList lst{ QStringLiteral("foo"), QStringLiteral("foo"), QStringLiteral("foo")};
params1.setSubject(subject); params1.setSubject(subject);
...@@ -81,12 +85,14 @@ void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue() ...@@ -81,12 +85,14 @@ void PluginEditorCheckBeforeSendParamsTest::shouldAssignValue()
params1.setIdentity(identity); params1.setIdentity(identity);
params1.setAddresses(lst); params1.setAddresses(lst);
params1.setDefaultDomain(defaultDomain); params1.setDefaultDomain(defaultDomain);
params1.setHasAttachment(hasAttachment);
QCOMPARE(params1.isHtmlMail(), isHmlMail); QCOMPARE(params1.isHtmlMail(), isHmlMail);
QCOMPARE(params1.subject(), subject); QCOMPARE(params1.subject(), subject);
QCOMPARE(params1.identity(), identity); QCOMPARE(params1.identity(), identity);
QCOMPARE(params1.plainText(), plainText); QCOMPARE(params1.plainText(), plainText);
QCOMPARE(params1.addresses(), lst); QCOMPARE(params1.addresses(), lst);
QCOMPARE(params1.defaultDomain(), defaultDomain); QCOMPARE(params1.defaultDomain(), defaultDomain);
QCOMPARE(params1.hasAttachment(), hasAttachment);
} }
QTEST_MAIN(PluginEditorCheckBeforeSendParamsTest) QTEST_MAIN(PluginEditorCheckBeforeSendParamsTest)
...@@ -28,7 +28,8 @@ class MessageComposer::PluginEditorCheckBeforeSendParamsPrivate ...@@ -28,7 +28,8 @@ class MessageComposer::PluginEditorCheckBeforeSendParamsPrivate
public: public:
PluginEditorCheckBeforeSendParamsPrivate() PluginEditorCheckBeforeSendParamsPrivate()
: identity(-1), : identity(-1),
isHtml(false) isHtml(false),
hasAttachment(false)
{ {
} }
...@@ -38,6 +39,7 @@ public: ...@@ -38,6 +39,7 @@ public:
QString defaultDomain; QString defaultDomain;
uint identity; uint identity;
bool isHtml; bool isHtml;
bool hasAttachment;
}; };
PluginEditorCheckBeforeSendParams::PluginEditorCheckBeforeSendParams() PluginEditorCheckBeforeSendParams::PluginEditorCheckBeforeSendParams()
...@@ -66,6 +68,7 @@ PluginEditorCheckBeforeSendParams &PluginEditorCheckBeforeSendParams::operator=( ...@@ -66,6 +68,7 @@ PluginEditorCheckBeforeSendParams &PluginEditorCheckBeforeSendParams::operator=(
d->plainText = other.plainText(); d->plainText = other.plainText();
d->listAddress = other.addresses(); d->listAddress = other.addresses();
d->defaultDomain = other.defaultDomain(); d->defaultDomain = other.defaultDomain();
d->hasAttachment = other.hasAttachment();
} }
return *this; return *this;
} }
...@@ -77,7 +80,8 @@ bool PluginEditorCheckBeforeSendParams::operator ==(const PluginEditorCheckBefor ...@@ -77,7 +80,8 @@ bool PluginEditorCheckBeforeSendParams::operator ==(const PluginEditorCheckBefor
(d->isHtml == other.isHtmlMail()) && (d->isHtml == other.isHtmlMail()) &&
(d->plainText == other.plainText()) && (d->plainText == other.plainText()) &&
(d->listAddress == other.addresses()) && (d->listAddress == other.addresses()) &&
(d->defaultDomain == other.defaultDomain()); (d->defaultDomain == other.defaultDomain()) &&
(d->hasAttachment == other.hasAttachment());
} }
void PluginEditorCheckBeforeSendParams::setSubject(const QString &subject) void PluginEditorCheckBeforeSendParams::setSubject(const QString &subject)
...@@ -139,3 +143,13 @@ QString PluginEditorCheckBeforeSendParams::defaultDomain() const ...@@ -139,3 +143,13 @@ QString PluginEditorCheckBeforeSendParams::defaultDomain() const
{ {
return d->defaultDomain; return d->defaultDomain;
} }
bool PluginEditorCheckBeforeSendParams::hasAttachment() const
{
return d->hasAttachment;
}
void PluginEditorCheckBeforeSendParams::setHasAttachment(bool b)
{
d->hasAttachment = b;
}
...@@ -51,6 +51,9 @@ public: ...@@ -51,6 +51,9 @@ public:
void setDefaultDomain(const QString &domain); void setDefaultDomain(const QString &domain);
QString defaultDomain() const; QString defaultDomain() const;
bool hasAttachment() const;
void setHasAttachment(bool b);
PluginEditorCheckBeforeSendParams &operator =(const PluginEditorCheckBeforeSendParams &other); PluginEditorCheckBeforeSendParams &operator =(const PluginEditorCheckBeforeSendParams &other);
bool operator ==(const PluginEditorCheckBeforeSendParams &other) const; bool operator ==(const PluginEditorCheckBeforeSendParams &other) const;
private: 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