KPeople
21 #include <KLocalizedString>
25 Match::Match(
const QList<MatchReason> &reasons,
const QPersistentModelIndex &a,
const QPersistentModelIndex &b)
26 : reasons(reasons), indexA(a), indexB(b)
28 if (indexB < indexA) {
29 qSwap(indexA, indexB);
33 bool Match::operator==(
const Match &m)
const
35 return reasons == m.reasons
37 && indexB == m.indexB;
40 bool Match::operator<(
const Match &m)
const
42 return indexA < m.indexA
43 || (indexA == m.indexA && indexB < m.indexB);
46 QStringList Match::matchReasons()
const
49 for (MatchReason r : reasons) {
55 ret += i18n(
"E-mail");
62 QString Match::matchValue(MatchReason r,
const AbstractContact::Ptr &addr)
66 return addr->customProperty(AbstractContact::NameProperty).toString();
68 return addr->customProperty(AbstractContact::EmailProperty).toString();
73 QList<Match::MatchReason> Match::matchAt(
const AbstractContact::Ptr &value,
const AbstractContact::Ptr &toCompare)
75 QList<Match::MatchReason> ret;
77 QVariant name = value->customProperty(AbstractContact::NameProperty);
78 if (name.isValid() && name == toCompare->customProperty(AbstractContact::NameProperty)) {
79 ret.append(Match::NameMatch);
The KPeople namespace contains all the classes for Libkpeople.
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Fri Feb 13 2015 15:16:39 by
doxygen 1.8.9.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.