Changeset View
Changeset View
Standalone View
Standalone View
src/contacts/contactsservice.cpp
Show First 20 Lines • Show All 707 Lines • ▼ Show 20 Line(s) | 704 | Q_FOREACH(const auto &email, contact->emailList()) { | |||
---|---|---|---|---|---|
708 | if (email.mail() == preferredEmail) { | 708 | if (email.mail() == preferredEmail) { | ||
709 | output.append(" primary=\"true\""); | 709 | output.append(" primary=\"true\""); | ||
710 | } | 710 | } | ||
711 | output.append("/>"); | 711 | output.append("/>"); | ||
712 | } | 712 | } | ||
713 | 713 | | |||
714 | /* IMs */ | 714 | /* IMs */ | ||
715 | const QString im_str = QStringLiteral("<gd:im address=\"%1\" protocol=\"%2\" rel=\"http://schemas.google.com/g/2005#other\" primary=\"%3\"/>"); | 715 | const QString im_str = QStringLiteral("<gd:im address=\"%1\" protocol=\"%2\" rel=\"http://schemas.google.com/g/2005#other\" primary=\"%3\"/>"); | ||
716 | Q_FOREACH(const auto &impp, contact->imppList()) { | ||||
717 | output.append(im_str.arg(impp.address().path(), Contact::IMProtocolNameToScheme(impp.serviceType()), Utils::bool2Str(impp.isPreferred())).toUtf8()); | ||||
718 | } | ||||
716 | Q_FOREACH(const QString &im, contact->customs()) { | 719 | Q_FOREACH(const QString &im, contact->customs()) { | ||
717 | if (im.startsWith(QLatin1String("messaging/"))) { | 720 | if (im.startsWith(QLatin1String("messaging/"))) { | ||
718 | QString key = im.left(im.indexOf(QLatin1Char(':'))); | 721 | QString key = im.left(im.indexOf(QLatin1Char(':'))); | ||
719 | QString value = im.mid(im.indexOf(QLatin1Char(':')) + 1); | 722 | QString value = im.mid(im.indexOf(QLatin1Char(':')) + 1); | ||
720 | QString proto = key.mid(10); | 723 | QString proto = key.mid(10); | ||
721 | proto.chop(4); | 724 | proto.chop(4); | ||
722 | bool primary = (contact->custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("X-IMAddress")) == value); | 725 | bool primary = (contact->custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("X-IMAddress")) == value); | ||
723 | output.append(im_str.arg(value, Contact::IMProtocolNameToScheme(proto), Utils::bool2Str(primary)).toUtf8()); | 726 | output.append(im_str.arg(value, Contact::IMProtocolNameToScheme(proto), Utils::bool2Str(primary)).toUtf8()); | ||
▲ Show 20 Lines • Show All 495 Lines • Show Last 20 Lines |