Pimcommon

blacklistbalooemailsearchjob.cpp
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5
6*/
7
8#include "blacklistbalooemailsearchjob.h"
9
10#include <PIM/contactcompleter.h>
11using namespace PimCommon;
12
13BlackListBalooEmailSearchJob::BlackListBalooEmailSearchJob(QObject *parent)
14 : QObject(parent)
15{
16}
17
18BlackListBalooEmailSearchJob::~BlackListBalooEmailSearchJob() = default;
19
20bool BlackListBalooEmailSearchJob::start()
21{
22 const QString trimmedString = mSearchEmail.trimmed();
23 if (trimmedString.isEmpty()) {
25 return false;
26 }
27
28 Akonadi::Search::PIM::ContactCompleter com(trimmedString, mLimit);
29 Q_EMIT emailsFound(com.complete());
31 return true;
32}
33
34void BlackListBalooEmailSearchJob::setSearchEmail(const QString &searchEmail)
35{
36 mSearchEmail = searchEmail;
37}
38
39void BlackListBalooEmailSearchJob::setLimit(int limit)
40{
41 mLimit = qMax(10, limit);
42}
43
44#include "moc_blacklistbalooemailsearchjob.cpp"
folderdialogacltab.h
Q_EMITQ_EMIT
void deleteLater()
bool isEmpty() const const
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.