• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

libkdepim

  • sources
  • kde-4.14
  • kdepim
  • libkdepim
  • addressline
  • blacklistbaloocompletion
blacklistbalooemailsearchjob.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2015 Montel Laurent <montel@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 
19 */
20 
21 #include "blacklistbalooemailsearchjob.h"
22 
23 #include <baloo/pim/contactcompleter.h>
24 #include <QStringList>
25 using namespace KPIM;
26 
27 BlackListBalooEmailSearchJob::BlackListBalooEmailSearchJob(QObject *parent)
28  : QObject(parent),
29  mLimit(500)
30 {
31 
32 }
33 
34 BlackListBalooEmailSearchJob::~BlackListBalooEmailSearchJob()
35 {
36 
37 }
38 
39 bool BlackListBalooEmailSearchJob::start()
40 {
41  const QString trimmedString = mSearchEmail.trimmed();
42  if (trimmedString.isEmpty()) {
43  deleteLater();
44  return false;
45  }
46 
47  Baloo::PIM::ContactCompleter com(trimmedString, mLimit);
48  Q_EMIT emailsFound(com.complete());
49  deleteLater();
50  return true;
51 }
52 
53 void BlackListBalooEmailSearchJob::setSearchEmail(const QString &searchEmail)
54 {
55  mSearchEmail = searchEmail;
56 }
57 
58 void BlackListBalooEmailSearchJob::setLimit(int limit)
59 {
60  if (limit < 10) {
61  limit = 10;
62  }
63  mLimit = limit;
64 }
65 
66 
KPIM::BlackListBalooEmailSearchJob::start
bool start()
Definition: blacklistbalooemailsearchjob.cpp:39
blacklistbalooemailsearchjob.h
KPIM::BlackListBalooEmailSearchJob::setSearchEmail
void setSearchEmail(const QString &searchEmail)
Definition: blacklistbalooemailsearchjob.cpp:53
QObject
QString::isEmpty
bool isEmpty() const
QString::trimmed
QString trimmed() const
QObject::deleteLater
void deleteLater()
QString
KPIM::BlackListBalooEmailSearchJob::~BlackListBalooEmailSearchJob
~BlackListBalooEmailSearchJob()
Definition: blacklistbalooemailsearchjob.cpp:34
KPIM::BlackListBalooEmailSearchJob::setLimit
void setLimit(int limit)
Definition: blacklistbalooemailsearchjob.cpp:58
KPIM::BlackListBalooEmailSearchJob::BlackListBalooEmailSearchJob
BlackListBalooEmailSearchJob(QObject *parent=0)
Definition: blacklistbalooemailsearchjob.cpp:27
KPIM::BlackListBalooEmailSearchJob::emailsFound
void emailsFound(const QStringList &list)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal