Commit f848121d authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

AddresseeLineEdit: allow disabling completion from Akonadi

parent e093a7eb
......@@ -149,6 +149,21 @@ void AddresseeLineEdit::setEnableBalooSearch(bool enable)
d->setEnableBalooSearch(enable);
}
bool AddresseeLineEdit::enableBalooSearch() const
{
return d->enableAkonadiSearch();
}
void AddresseeLineEdit::setEnableAkonadiSearch(bool enable)
{
d->setEnableAkonadiSearch(enable);
}
bool AddresseeLineEdit::enableAkonadiSearch() const
{
return d->enableAkonadiSearch();
}
void AddresseeLineEdit::allowSemicolonAsSeparator(bool useSemicolonAsSeparator)
{
d->setUseSemicolonAsSeparator(useSemicolonAsSeparator);
......@@ -913,7 +928,7 @@ void AddresseeLineEdit::slotEditingFinished()
d->mightBeGroupJobsClear();
d->groupsClear();
if (!text().isEmpty()) {
if (!text().isEmpty() && enableAkonadiSearch()) {
const QStringList addresses = KEmailAddress::splitAddressList(text());
Q_FOREACH (const QString &address, addresses) {
Akonadi::ContactGroupSearchJob *job = new Akonadi::ContactGroupSearchJob();
......
......@@ -87,6 +87,9 @@ public:
void setFont(const QFont &font);
void setEnableBalooSearch(bool enable);
bool enableBalooSearch() const;
void setEnableAkonadiSearch(bool enable);
bool enableAkonadiSearch() const;
bool isCompletionEnabled() const;
......
......@@ -61,6 +61,7 @@ AddresseeLineEditPrivate::AddresseeLineEditPrivate(KPIM::AddresseeLineEdit *qq,
m_useSemicolonAsSeparator(false),
m_showOU(false),
m_enableBalooSearch(true),
m_enableAkonadiSearch(true),
mExpandIntern(true),
mAutoGroupExpand(false),
mShowRecentAddresses(true)
......@@ -489,7 +490,9 @@ void AddresseeLineEditPrivate::slotTriggerDelayedQueries()
// We send a contactsearch job through akonadi.
// This not only searches baloo but also servers if remote search is enabled
akonadiPerformSearch();
if (m_enableAkonadiSearch) {
akonadiPerformSearch();
}
}
void AddresseeLineEditPrivate::startSearches()
......@@ -983,6 +986,16 @@ void AddresseeLineEditPrivate::setEnableBalooSearch(bool enableBalooSearch)
m_enableBalooSearch = enableBalooSearch;
}
bool AddresseeLineEditPrivate::enableAkonadiSearch() const
{
return m_enableAkonadiSearch;
}
void AddresseeLineEditPrivate::setEnableAkonadiSearch(bool enableAkonadiSearch)
{
m_enableAkonadiSearch = enableAkonadiSearch;
}
QString AddresseeLineEditPrivate::searchString() const
{
return m_searchString;
......
......@@ -83,6 +83,9 @@ public:
bool useSemicolonAsSeparator() const;
void setUseSemicolonAsSeparator(bool useSemicolonAsSeparator);
bool enableAkonadiSearch() const;
void setEnableAkonadiSearch(bool enableAkonadiSearch);
void removeCompletionSource(const QString &source);
int addCompletionSource(const QString &source, int weight);
void restartTime(const QString &searchString);
......@@ -155,6 +158,7 @@ private:
bool m_useSemicolonAsSeparator;
bool m_showOU;
bool m_enableBalooSearch;
bool m_enableAkonadiSearch;
bool mExpandIntern;
bool mAutoGroupExpand;
bool mShowRecentAddresses;
......
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