Commit ac710c07 authored by Laurent Montel's avatar Laurent Montel 😁

Move to ldap class

parent 56b58509
......@@ -29,6 +29,7 @@ using namespace KPIM;
AddresseeLineEditLdap::AddresseeLineEditLdap(AddresseeLineEditManager *addressLineStatic, QObject *parent)
: QObject(parent)
, mLdapTimer(nullptr)
, mAddressLineEdit(nullptr)
, mLdapSearch(nullptr)
, mAddressLineStatic(addressLineStatic)
{
......@@ -113,3 +114,13 @@ void AddresseeLineEditLdap::setLdapText(const QString &ldapText)
{
mLdapText = ldapText;
}
AddresseeLineEdit *AddresseeLineEditLdap::addressLineEdit() const
{
return mAddressLineEdit;
}
void AddresseeLineEditLdap::setAddressLineEdit(AddresseeLineEdit *addressLineEdit)
{
mAddressLineEdit = addressLineEdit;
}
......@@ -30,6 +30,7 @@ class LdapClientSearch;
namespace KPIM {
class AddresseeLineEditManager;
class AddresseeLineEdit;
class AddresseeLineEditLdap : public QObject
{
public:
......@@ -50,6 +51,9 @@ public:
QString ldapText() const;
void setLdapText(const QString &ldapText);
AddresseeLineEdit *addressLineEdit() const;
void setAddressLineEdit(AddresseeLineEdit *addressLineEdit);
private:
// maps LDAP client indices to completion source indices
// the assumption that they are always the first n indices in s_static->completion
......@@ -57,6 +61,7 @@ private:
QMap<int, int> mLdapClientToCompletionSourceMap;
QString mLdapText;
QTimer *mLdapTimer;
AddresseeLineEdit *mAddressLineEdit;
KLDAP::LdapClientSearch *mLdapSearch;
AddresseeLineEditManager *mAddressLineStatic;
......
......@@ -31,8 +31,7 @@ using namespace KPIM;
Q_GLOBAL_STATIC(AddresseeLineEditManager, sInstance)
AddresseeLineEditManager::AddresseeLineEditManager()
: mAddressLineEdit(nullptr)
, mCompletion(new KMailCompletion)
: mCompletion(new KMailCompletion)
, mAddresseeLineEditAkonadi(new AddresseeLineEditAkonadi(this))
, mAddressessLineEditLdap(new AddresseeLineEditLdap(this))
, mAddressessLineEditBaloo(new AddresseeLineEditBaloo(this))
......@@ -108,12 +107,12 @@ KMailCompletion *AddresseeLineEditManager::completion() const
AddresseeLineEdit *AddresseeLineEditManager::addressLineEdit() const
{
return mAddressLineEdit;
return mAddressessLineEditLdap->addressLineEdit();
}
void AddresseeLineEditManager::setAddressLineEdit(AddresseeLineEdit *addressLineEdit)
{
mAddressLineEdit = addressLineEdit;
mAddressessLineEditLdap->setAddressLineEdit(addressLineEdit);
}
KLDAP::LdapClientSearch *AddresseeLineEditManager::ldapSearch() const
......
......@@ -109,8 +109,6 @@ public:
void setAddressLineEdit(AddresseeLineEdit *addressLineEdit);
private:
AddresseeLineEdit *mAddressLineEdit;
KMailCompletion *mCompletion;
AddresseeLineEditAkonadi *mAddresseeLineEditAkonadi;
AddresseeLineEditLdap *mAddressessLineEditLdap;
......
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