summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-05-10 13:37:03 +0200
committerMontel Laurent <[email protected]>2017-05-10 13:37:03 +0200
commit48f8757310ab29fd3233ce94edda34cbe854ce13 (patch)
treea3a783334efb39c37f9558fe0ef7bba414d1d876
parent5c3ba759235b4f3c2a2bb00c8d22027fd9655cac (diff)
Use new pimcommon api (avoid duplicate code)
-rw-r--r--CMakeLists.txt2
-rw-r--r--kmail/editorsendcheckplugins/automaticaddcontacts/automaticaddcontactsjob.cpp14
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp14
3 files changed, 5 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be8412c..ad1e33e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,7 +60,7 @@ find_package(KF5Declarative ${KF5_VERSION} CONFIG REQUIRED)
set(MAILCOMMON_LIB_VERSION "5.5.40")
set(GRAVATAR_LIB_VERSION "5.5.40")
-set(PIMCOMMON_LIB_VERSION "5.5.40")
+set(PIMCOMMON_LIB_VERSION "5.5.41")
set(GRANTLEETHEME_LIB_VERSION "5.5.40")
set(CALENDARSUPPORT_LIB_VERSION "5.5.40")
set(EVENTVIEW_LIB_VERSION "5.5.40")
diff --git a/kmail/editorsendcheckplugins/automaticaddcontacts/automaticaddcontactsjob.cpp b/kmail/editorsendcheckplugins/automaticaddcontacts/automaticaddcontactsjob.cpp
index a041e59..ab14649 100644
--- a/kmail/editorsendcheckplugins/automaticaddcontacts/automaticaddcontactsjob.cpp
+++ b/kmail/editorsendcheckplugins/automaticaddcontacts/automaticaddcontactsjob.cpp
@@ -30,6 +30,7 @@
#include <Akonadi/Contact/ContactSearchJob>
#include <AkonadiCore/ItemCreateJob>
#include <KEmailAddress>
+#include <PimCommon/PimUtil>
#include <QPointer>
#include <akonadi/contact/selectaddressbookdialog.h>
#include <AkonadiCore/AgentFilterProxyModel>
@@ -246,18 +247,7 @@ void AutomaticAddContactsJob::addNextContact()
void AutomaticAddContactsJob::setEmails(const QStringList &list)
{
- QString str;
- for (int i = 0; i < list.count(); i++) {
- QString tmpStr = list.at(i);
- if (!tmpStr.trimmed().isEmpty()) {
- if (!str.isEmpty()) {
- str.append(QStringLiteral(", "));
- }
- str.append(tmpStr);
- }
- }
- const QStringList emails = KEmailAddress::splitAddressList(str);
- mEmails = emails;
+ mEmails = PimCommon::Util::generateEmailList(list);
}
void AutomaticAddContactsJob::setCollection(const Akonadi::Collection &collection)
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp
index 292ae21..92efdb9 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp
@@ -20,6 +20,7 @@
#include "checkattachmentjob.h"
#include <KEmailAddress>
+#include <PimCommon/PimUtil>
CheckAttachmentJob::CheckAttachmentJob()
{
@@ -51,18 +52,7 @@ QStringList CheckAttachmentJob::originalEmails() const
void CheckAttachmentJob::setOriginalEmails(const QStringList &list)
{
- QString str;
- for (int i = 0; i < list.count(); i++) {
- QString tmpStr = list.at(i);
- if (!tmpStr.trimmed().isEmpty()) {
- if (!str.isEmpty()) {
- str.append(QStringLiteral(", "));
- }
- str.append(tmpStr);
- }
- }
- const QStringList emails = KEmailAddress::splitAddressList(str);
- mOriginalEmails = emails;
+ mOriginalEmails = PimCommon::Util::generateEmailList(list);
}
QStringList CheckAttachmentJob::resultList() const