7#include "addresseelineeditakonadisearch.h"
8#include "akonadisearchcompletionemail.h"
10#include <KSharedConfig>
14AddresseeLineEditAkonadiSearch::AddresseeLineEditAkonadiSearch()
15 : mAkonadiSearchCompletionEmail(new
PimCommon::AkonadiSearchCompletionEmail)
17 loadAkonadiSearchBlackList();
20AddresseeLineEditAkonadiSearch::~AddresseeLineEditAkonadiSearch()
22 delete mAkonadiSearchCompletionEmail;
25int AddresseeLineEditAkonadiSearch::akonadiSearchCompletionSource()
const
27 return mAkonadiSearchCompletionSource;
30void AddresseeLineEditAkonadiSearch::setAkonadiSearchCompletionSource(
int value)
32 mAkonadiSearchCompletionSource = value;
35QStringList AddresseeLineEditAkonadiSearch::akonadiSearchBlackList()
const
37 return mAkonadiSearchCompletionEmail->balooCompletionEmailInfo().mBlackList;
40QStringList AddresseeLineEditAkonadiSearch::domainExcludeList()
const
42 return mAkonadiSearchCompletionEmail->balooCompletionEmailInfo().mExcludeDomains;
45void AddresseeLineEditAkonadiSearch::loadAkonadiSearchBlackList()
48 config->reparseConfiguration();
49 KConfigGroup group(config, QStringLiteral(
"AddressLineEdit"));
50 PimCommon::AkonadiSearchCompletionEmail::AkonadiSearchCompletionEmailInfo info;
53 const QStringList lstExcludeEmailsRegularExpressions = group.readEntry(
"ExcludeEmailsRegexp",
QStringList());
55 info.mExcludeEmailsRegularExpressions = lstExcludeEmailsRegularExpressions;
56 info.mBlackList = balooBlackList;
57 info.mExcludeDomains = domainExcludeList;
58 mAkonadiSearchCompletionEmail->setBalooCompletionEmailInfo(info);
63 PimCommon::AkonadiSearchCompletionEmail::AkonadiSearchCompletionEmailInfo info = mAkonadiSearchCompletionEmail->balooCompletionEmailInfo();
64 info.mListEmail = inputList;
65 mAkonadiSearchCompletionEmail->setBalooCompletionEmailInfo(info);
66 return mAkonadiSearchCompletionEmail->cleanupEmailList();
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, QStandardPaths::StandardLocation type=QStandardPaths::GenericConfigLocation)