Commit caee17dd authored by David Faure's avatar David Faure

IdentityManager: add self() method

Creating IdentityManager can take time, so sharing seems like a good idea.

Differential Revision: https://phabricator.kde.org/D2307
parent e7656d42
......@@ -18,7 +18,7 @@ include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
set(PIM_VERSION "5.2.90")
set(PIM_VERSION "5.2.91")
set(KIDENTITYMANAGEMENT_LIB_VERSION ${PIM_VERSION})
set(PIMTEXTEDIT_LIB_VERSION "5.2.90")
......
......@@ -285,6 +285,13 @@ void IdentityManager::Private::slotIdentitiesChanged(const QString &id)
}
}
Q_GLOBAL_STATIC(IdentityManager, s_self)
IdentityManager *IdentityManager::self()
{
return s_self;
}
IdentityManager::IdentityManager(bool readonly, QObject *parent,
const char *name)
: QObject(parent),
......
......@@ -50,6 +50,15 @@ public:
const char *name = 0);
virtual ~IdentityManager();
/**
* Creates or reuses the identity manager instance for this process.
* It loads the emailidentities file to create identities.
* This sets readonly to false, so you should create a separate instance
* if you need it to be readonly.
* @since 5.2.91
*/
IdentityManager *self();
public:
typedef QList<Identity>::Iterator Iterator;
typedef QList<Identity>::ConstIterator ConstIterator;
......
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