summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-01 18:42:52 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-01 18:42:52 (GMT)
commit2c355f0faacb6cb016edcbabba173875db6b04ac (patch)
tree70c1d320084e81819a40aebf9d2ced7d78e23ff7
parent5a2c6a81f159799443cf76f417cabeaf1925b8f1 (diff)
Don't create new kidentitymanager when not necessary
-rw-r--r--src/ksieveui/vacation/vacation.cpp3
-rw-r--r--src/ksieveui/vacation/vacationutils.cpp6
2 files changed, 3 insertions, 6 deletions
diff --git a/src/ksieveui/vacation/vacation.cpp b/src/ksieveui/vacation/vacation.cpp
index ee1b88b..11e4dca 100644
--- a/src/ksieveui/vacation/vacation.cpp
+++ b/src/ksieveui/vacation/vacation.cpp
@@ -26,9 +26,6 @@
#include <KLocalizedString>
#include <kmessagebox.h>
-#include <KIdentityManagement/kidentitymanagement/identity.h>
-#include <KIdentityManagement/kidentitymanagement/identitymanager.h>
-
using namespace KSieveUi;
Vacation::Vacation(QObject *parent, bool checkOnly, const QUrl &url)
diff --git a/src/ksieveui/vacation/vacationutils.cpp b/src/ksieveui/vacation/vacationutils.cpp
index 9f72abf..ec501fb 100644
--- a/src/ksieveui/vacation/vacationutils.cpp
+++ b/src/ksieveui/vacation/vacationutils.cpp
@@ -96,9 +96,9 @@ int VacationUtils::defaultNotificationInterval()
KMime::Types::AddrSpecList VacationUtils::defaultMailAliases()
{
KMime::Types::AddrSpecList sl;
- KIdentityManagement::IdentityManager manager(true);
- KIdentityManagement::IdentityManager::ConstIterator end(manager.end());
- for (KIdentityManagement::IdentityManager::ConstIterator it = manager.begin(); it != end; ++it) {
+ KIdentityManagement::IdentityManager *manager = KIdentityManagement::IdentityManager::self();
+ KIdentityManagement::IdentityManager::ConstIterator end(manager->end());
+ for (KIdentityManagement::IdentityManager::ConstIterator it = manager->begin(); it != end; ++it) {
if (!(*it).primaryEmailAddress().isEmpty()) {
KMime::Types::Mailbox a;
a.fromUnicodeString((*it).primaryEmailAddress());