Exemple #1
0
void AddresseeTest::fullEmailTest()
{
    KContacts::Addressee a;
    QStringList emails;
    emails << QStringLiteral("*****@*****.**");
    a.setEmails(emails);
    a.setFormattedName(QStringLiteral("firstname \"nickname\" lastname"));
    QCOMPARE(a.fullEmail(),
             QStringLiteral("\"firstname \\\"nickname\\\" lastname\" <*****@*****.**>"));
}
QString MergeContactWidgetList::itemName(const KContacts::Addressee &address) const
{
    const QString realName = address.realName();
    if (!realName.isEmpty()) {
        return realName;
    }
    const QString name = address.name();
    if (!name.isEmpty()) {
        return name;
    }
    return address.fullEmail();
}