Commit 2c355f0f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Don't create new kidentitymanager when not necessary

parent 5a2c6a81
......@@ -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)
......
......@@ -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());
......
Supports Markdown
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