data/VCardPeoplePatch.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Write side of the Sprint 103 people details (S103.1.1–S103.1.3, S103.1.11). | ||
| 2 | // | ||
| 3 | // Same contract as VCardPatch.cpp: only what the user changed is rewritten; | ||
| 4 | // a value whose sourceIndex and content are unchanged keeps its line byte | ||
| 5 | // for byte (G1). A changed value is replaced in place (same position, its | ||
| 6 | // label group renewed), a removed value goes with its group, a new value is | ||
| 7 | // inserted behind the last line of its kind. Every value is written in the | ||
| 8 | // card's own version (D-3, D-8, D-9): a 3.0 card never gains 4.0-only syntax. | ||
| 9 | #include "RelationVocabulary.h" | ||
| 10 | #include "VCardCodec.h" | ||
| 11 | #include "VCardWriter.h" | ||
| 12 | |||
| 13 | #include <QRegularExpression> | ||
| 14 | #include <QSet> | ||
| 15 | #include <QUrl> | ||
| 16 | |||
| 17 | namespace VCardCodec::detail { | ||
| 18 | |||
| 19 | namespace { | ||
| 20 | |||
| 21 | const QSet<QString> kSocialNames{QStringLiteral("X-SOCIALPROFILE"), QStringLiteral("SOCIALPROFILE"), | ||
| 22 | QStringLiteral("IMPP")}; | ||
| 23 | |||
| 24 | 542 | bool isUuid(const QString &text) { | |
| 25 | static const QRegularExpression pattern( | ||
| 26 |
4/7✓ Branch 2 → 3 taken 7 times.
✓ Branch 2 → 15 taken 535 times.
✓ Branch 4 → 5 taken 7 times.
✗ Branch 4 → 15 not taken.
✓ Branch 9 → 10 taken 7 times.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
549 | QStringLiteral("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")); |
| 27 |
2/2✓ Branch 16 → 17 taken 542 times.
✓ Branch 17 → 18 taken 542 times.
|
542 | return pattern.match(text).hasMatch(); |
| 28 | } | ||
| 29 | |||
| 30 | 4169 | ICal::Property make(const QString &name, const QString &value, const QList<ICal::Parameter> ¶meters = {}) { | |
| 31 | 4169 | ICal::Property property; | |
| 32 | 4169 | property.name = name; | |
| 33 | 4169 | property.value = value; | |
| 34 | 4169 | property.parameters = parameters; | |
| 35 | 4169 | return property; | |
| 36 | } | ||
| 37 | |||
| 38 | // Inserts `lines` (a property plus optional label) as one group at | ||
| 39 | // `position`; the first line carries the group when a label is given. | ||
| 40 | 1545 | int insertGrouped(Writer *w, int position, ICal::Property property, const QString &label) { | |
| 41 |
2/2✓ Branch 3 → 4 taken 737 times.
✓ Branch 3 → 29 taken 808 times.
|
1545 | if (!label.isEmpty()) { |
| 42 |
1/1✓ Branch 4 → 5 taken 737 times.
|
737 | const QString group = freeGroup(w->card); |
| 43 |
2/2✓ Branch 7 → 8 taken 737 times.
✓ Branch 8 → 9 taken 737 times.
|
737 | property.name = group + QLatin1Char('.') + property.name; |
| 44 |
1/1✓ Branch 12 → 13 taken 737 times.
|
737 | w->insert(position, property); |
| 45 |
3/3✓ Branch 14 → 15 taken 737 times.
✓ Branch 18 → 19 taken 737 times.
✓ Branch 20 → 21 taken 737 times.
|
1474 | w->insert(position + 1, make(group + QStringLiteral(".X-ABLabel"), ICal::escapeText(label))); |
| 46 | 737 | return position + 2; | |
| 47 | 737 | } | |
| 48 | 808 | w->insert(position, property); | |
| 49 | 808 | return position + 1; | |
| 50 | } | ||
| 51 | |||
| 52 | // Position behind the last property whose base name is in `names`; the end | ||
| 53 | // of the card when none exists. | ||
| 54 | 3115 | int insertionPoint(const Writer &w, const QSet<QString> &names) { | |
| 55 | 3115 | int at = -1; | |
| 56 |
2/2✓ Branch 29 → 3 taken 52803 times.
✓ Branch 29 → 30 taken 3115 times.
|
55918 | for (int i = 0; i < w.card.properties.size(); ++i) |
| 57 |
3/3✓ Branch 4 → 5 taken 52803 times.
✓ Branch 7 → 8 taken 7016 times.
✓ Branch 7 → 27 taken 45787 times.
|
52803 | if (names.contains(baseName(w.card.properties.at(i)))) { |
| 58 | 7016 | at = i + 1; | |
| 59 |
1/1✓ Branch 9 → 10 taken 7016 times.
|
7016 | const QString group = groupOf(w.card.properties.at(i)); |
| 60 |
11/13✓ Branch 13 → 14 taken 3002 times.
✓ Branch 13 → 21 taken 5511 times.
✓ Branch 15 → 16 taken 2931 times.
✓ Branch 15 → 21 taken 71 times.
✓ Branch 17 → 18 taken 2931 times.
✓ Branch 19 → 20 taken 1497 times.
✓ Branch 19 → 21 taken 1434 times.
✓ Branch 22 → 23 taken 2931 times.
✓ Branch 22 → 24 taken 5582 times.
✓ Branch 24 → 11 taken 1497 times.
✓ Branch 24 → 25 taken 7016 times.
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 39 not taken.
|
8513 | while (!group.isEmpty() && at < w.card.properties.size() && groupOf(w.card.properties.at(at)) == group) |
| 61 | 1497 | ++at; | |
| 62 | 7016 | } | |
| 63 |
2/2✓ Branch 30 → 31 taken 1629 times.
✓ Branch 30 → 33 taken 1486 times.
|
3115 | return at < 0 ? int(w.card.properties.size()) : at; |
| 64 | } | ||
| 65 | |||
| 66 | // Generic list patch: `same` decides whether an edited value equals the | ||
| 67 | // value parsed from its source line; `write` inserts the new form at a | ||
| 68 | // position and returns the position behind it. | ||
| 69 | template <typename T, typename Same, typename Write> | ||
| 70 | 2020 | void patchList(Writer *w, const QList<T> &before, const QList<T> &after, const QSet<QString> &names, Same same, | |
| 71 | Write write) { | ||
| 72 | 2020 | QSet<int> handled; | |
| 73 |
10/10void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 29 → 5 taken 100 times.
✓ Branch 29 → 30 taken 94 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 29 → 5 taken 958 times.
✓ Branch 29 → 30 taken 589 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 29 → 5 taken 1420 times.
✓ Branch 29 → 30 taken 139 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 29 → 5 taken 1768 times.
✓ Branch 29 → 30 taken 734 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 29 → 5 taken 696 times.
✓ Branch 29 → 30 taken 464 times.
|
6962 | for (const T &value : after) { |
| 74 |
10/10void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 6 → 7 taken 94 times.
✓ Branch 6 → 8 taken 6 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 6 → 7 taken 618 times.
✓ Branch 6 → 8 taken 340 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 6 → 7 taken 138 times.
✓ Branch 6 → 8 taken 1282 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 6 → 7 taken 944 times.
✓ Branch 6 → 8 taken 824 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 6 → 7 taken 462 times.
✓ Branch 6 → 8 taken 234 times.
|
4942 | if (value.sourceIndex < 0) |
| 75 | 2256 | continue; | |
| 76 | 2686 | const int index = w->currentIndex(value.sourceIndex); | |
| 77 |
5/10void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 6 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 340 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 1282 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 824 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 234 times.
|
2686 | if (index < 0) |
| 78 | ✗ | continue; | |
| 79 |
5/10void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 25 → 13 taken 8 times.
✗ Branch 25 → 26 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 25 → 13 taken 526 times.
✗ Branch 25 → 26 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 25 → 13 taken 22113 times.
✗ Branch 25 → 26 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 25 → 13 taken 1915 times.
✗ Branch 25 → 26 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 25 → 13 taken 234 times.
✗ Branch 25 → 26 not taken.
|
24796 | for (const T &old : before) { |
| 80 |
9/10void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 14 → 15 taken 2 times.
✓ Branch 14 → 16 taken 6 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 14 → 15 taken 186 times.
✓ Branch 14 → 16 taken 340 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 14 → 15 taken 20831 times.
✓ Branch 14 → 16 taken 1282 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 14 → 15 taken 1091 times.
✓ Branch 14 → 16 taken 824 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 234 times.
|
24796 | if (old.sourceIndex != value.sourceIndex) |
| 81 | 22110 | continue; | |
| 82 |
5/5void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 16 → 17 taken 6 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 16 → 17 taken 340 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 16 → 17 taken 1282 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 16 → 17 taken 824 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 16 → 17 taken 234 times.
|
2686 | handled.insert(value.sourceIndex); |
| 83 |
6/10void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 18 → 19 taken 6 times.
✗ Branch 18 → 20 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 18 → 19 taken 340 times.
✗ Branch 18 → 20 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 18 → 19 taken 1282 times.
✗ Branch 18 → 20 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 18 → 19 taken 821 times.
✓ Branch 18 → 20 taken 3 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 18 → 19 taken 234 times.
✗ Branch 18 → 20 not taken.
|
2686 | if (same(old, value)) |
| 84 | 2683 | break; | |
| 85 |
1/5void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✗ Branch 20 → 21 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✗ Branch 20 → 21 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✗ Branch 20 → 21 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 20 → 21 taken 3 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✗ Branch 20 → 21 not taken.
|
3 | removeWithGroup(w, index); |
| 86 |
1/5void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✗ Branch 21 → 22 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✗ Branch 21 → 22 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✗ Branch 21 → 22 not taken.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 21 → 22 taken 3 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✗ Branch 21 → 22 not taken.
|
3 | write(index, value); |
| 87 | 3 | break; | |
| 88 | } | ||
| 89 | } | ||
| 90 |
10/10void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 43 → 32 taken 7 times.
✓ Branch 43 → 44 taken 94 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 43 → 32 taken 341 times.
✓ Branch 43 → 44 taken 589 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 43 → 32 taken 1284 times.
✓ Branch 43 → 44 taken 139 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 43 → 32 taken 837 times.
✓ Branch 43 → 44 taken 734 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 43 → 32 taken 236 times.
✓ Branch 43 → 44 taken 464 times.
|
4725 | for (const T &old : before) { |
| 91 | 2705 | const int index = w->currentIndex(old.sourceIndex); | |
| 92 |
25/30void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 35 → 36 taken 1 time.
✓ Branch 35 → 38 taken 6 times.
✓ Branch 36 → 37 taken 1 time.
✗ Branch 36 → 38 not taken.
✓ Branch 39 → 40 taken 1 time.
✓ Branch 39 → 41 taken 6 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 35 → 36 taken 1 time.
✓ Branch 35 → 38 taken 340 times.
✓ Branch 36 → 37 taken 1 time.
✗ Branch 36 → 38 not taken.
✓ Branch 39 → 40 taken 1 time.
✓ Branch 39 → 41 taken 340 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 35 → 36 taken 2 times.
✓ Branch 35 → 38 taken 1282 times.
✓ Branch 36 → 37 taken 2 times.
✗ Branch 36 → 38 not taken.
✓ Branch 39 → 40 taken 2 times.
✓ Branch 39 → 41 taken 1282 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 35 → 36 taken 13 times.
✓ Branch 35 → 38 taken 824 times.
✓ Branch 36 → 37 taken 13 times.
✗ Branch 36 → 38 not taken.
✓ Branch 39 → 40 taken 13 times.
✓ Branch 39 → 41 taken 824 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 35 → 36 taken 2 times.
✓ Branch 35 → 38 taken 234 times.
✓ Branch 36 → 37 taken 2 times.
✗ Branch 36 → 38 not taken.
✓ Branch 39 → 40 taken 2 times.
✓ Branch 39 → 41 taken 234 times.
|
2705 | if (!handled.contains(old.sourceIndex) && index >= 0) |
| 93 |
5/5void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 40 → 41 taken 1 time.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 40 → 41 taken 1 time.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 40 → 41 taken 2 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 40 → 41 taken 13 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 40 → 41 taken 2 times.
|
19 | removeWithGroup(w, index); |
| 94 | } | ||
| 95 |
5/5void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 44 → 45 taken 94 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 44 → 45 taken 589 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 44 → 45 taken 139 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 44 → 45 taken 734 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 44 → 45 taken 464 times.
|
2020 | int position = insertionPoint(*w, names); |
| 96 |
10/10void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 58 → 47 taken 100 times.
✓ Branch 58 → 59 taken 94 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 58 → 47 taken 958 times.
✓ Branch 58 → 59 taken 589 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 58 → 47 taken 1420 times.
✓ Branch 58 → 59 taken 139 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 58 → 47 taken 1768 times.
✓ Branch 58 → 59 taken 734 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 58 → 47 taken 696 times.
✓ Branch 58 → 59 taken 464 times.
|
6962 | for (const T &value : after) |
| 97 |
25/30void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 48 → 49 taken 6 times.
✓ Branch 48 → 51 taken 94 times.
✗ Branch 50 → 51 not taken.
✓ Branch 50 → 52 taken 6 times.
✓ Branch 53 → 54 taken 94 times.
✓ Branch 53 → 56 taken 6 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 48 → 49 taken 340 times.
✓ Branch 48 → 51 taken 618 times.
✗ Branch 50 → 51 not taken.
✓ Branch 50 → 52 taken 340 times.
✓ Branch 53 → 54 taken 618 times.
✓ Branch 53 → 56 taken 340 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 48 → 49 taken 1282 times.
✓ Branch 48 → 51 taken 138 times.
✗ Branch 50 → 51 not taken.
✓ Branch 50 → 52 taken 1282 times.
✓ Branch 53 → 54 taken 138 times.
✓ Branch 53 → 56 taken 1282 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 48 → 49 taken 824 times.
✓ Branch 48 → 51 taken 944 times.
✗ Branch 50 → 51 not taken.
✓ Branch 50 → 52 taken 824 times.
✓ Branch 53 → 54 taken 944 times.
✓ Branch 53 → 56 taken 824 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 48 → 49 taken 234 times.
✓ Branch 48 → 51 taken 462 times.
✗ Branch 50 → 51 not taken.
✓ Branch 50 → 52 taken 234 times.
✓ Branch 53 → 54 taken 462 times.
✓ Branch 53 → 56 taken 234 times.
|
4942 | if (value.sourceIndex < 0 || !handled.contains(value.sourceIndex)) |
| 98 |
5/5void VCardCodec::detail::(anonymous namespace)::patchList<ContactDate, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}>(VCardCodec::detail::Writer*, QList<ContactDate> const&, QList<ContactDate> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactDate const&, ContactDate const&)#1}, VCardCodec::detail::(anonymous namespace)::applyPersonal(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactDate const&)#1}):
✓ Branch 54 → 55 taken 94 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactSocial, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}>(VCardCodec::detail::Writer*, QList<ContactSocial> const&, QList<ContactSocial> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactSocial const&, ContactSocial const&)#1}, VCardCodec::detail::(anonymous namespace)::applySocial(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactSocial const&)#1}):
✓ Branch 54 → 55 taken 618 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactMailLink, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}>(VCardCodec::detail::Writer*, QList<ContactMailLink> const&, QList<ContactMailLink> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactMailLink const&, ContactMailLink const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMailLinks(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactMailLink const&)#1}):
✓ Branch 54 → 55 taken 138 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactRelation, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}>(VCardCodec::detail::Writer*, QList<ContactRelation> const&, QList<ContactRelation> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactRelation const&, ContactRelation const&)#1}, VCardCodec::detail::(anonymous namespace)::applyRelations(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactRelation const&)#1}):
✓ Branch 54 → 55 taken 944 times.
void VCardCodec::detail::(anonymous namespace)::patchList<ContactPersonRef, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}>(VCardCodec::detail::Writer*, QList<ContactPersonRef> const&, QList<ContactPersonRef> const&, QSet<QString> const&, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(ContactPersonRef const&, ContactPersonRef const&)#1}, VCardCodec::detail::(anonymous namespace)::applyMet(VCardCodec::detail::Writer*, ContactCard const&, ContactCard const&)::{lambda(int, ContactPersonRef const&)#1}):
✓ Branch 54 → 55 taken 462 times.
|
2256 | position = write(position, value); |
| 99 | 2020 | } | |
| 100 | |||
| 101 | // ─── relationships (D-3, D-4) ─── | ||
| 102 | |||
| 103 | 1198 | bool appleModel(const ICal::Component &card) { | |
| 104 |
3/3✓ Branch 5 → 6 taken 1198 times.
✓ Branch 8 → 9 taken 4 times.
✓ Branch 8 → 10 taken 1194 times.
|
1198 | if (indexOfName(card, QStringLiteral("X-ABRELATEDNAMES")) >= 0) |
| 105 | 4 | return true; | |
| 106 |
1/1✓ Branch 13 → 14 taken 1194 times.
|
1194 | const int prodid = indexOfName(card, QStringLiteral("PRODID")); |
| 107 |
7/11✓ Branch 16 → 17 taken 1115 times.
✓ Branch 16 → 27 taken 79 times.
✓ Branch 20 → 21 taken 1115 times.
✓ Branch 21 → 22 taken 348 times.
✓ Branch 21 → 27 taken 767 times.
✓ Branch 30 → 31 taken 1115 times.
✓ Branch 30 → 32 taken 79 times.
✗ Branch 47 → 48 not taken.
✗ Branch 47 → 49 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 51 → 53 not taken.
|
3851 | return prodid >= 0 && indexOfName(card, QStringLiteral("RELATED")) < 0 && |
| 108 |
5/5✓ Branch 24 → 25 taken 348 times.
✓ Branch 25 → 26 taken 5 times.
✓ Branch 25 → 27 taken 343 times.
✓ Branch 28 → 29 taken 1115 times.
✓ Branch 28 → 30 taken 79 times.
|
1542 | card.properties.at(prodid).value.contains(QLatin1String("Apple Inc.")); |
| 109 | } | ||
| 110 | |||
| 111 | // The value and parameters of a reference to a person: urn:uuid for a card | ||
| 112 | // with a UUID UID, the stored URI, else the text form (non-UUID UIDs go into | ||
| 113 | // X-MAILJD-UID). | ||
| 114 | 1409 | void addTarget(ICal::Property *property, const QString &uri, const QString &uid, const QString &name, bool apple) { | |
| 115 |
2/2✓ Branch 2 → 3 taken 10 times.
✓ Branch 2 → 17 taken 1399 times.
|
1409 | if (apple) { |
| 116 |
1/1✓ Branch 3 → 4 taken 10 times.
|
10 | property->value = ICal::escapeText(name); |
| 117 |
2/2✓ Branch 7 → 8 taken 8 times.
✓ Branch 7 → 16 taken 2 times.
|
10 | if (!uid.isEmpty()) |
| 118 | 16 | property->parameters.append({QStringLiteral("X-MAILJD-UID"), uid}); | |
| 119 | 10 | return; | |
| 120 | } | ||
| 121 |
6/6✓ Branch 18 → 19 taken 542 times.
✓ Branch 18 → 22 taken 857 times.
✓ Branch 20 → 21 taken 503 times.
✓ Branch 20 → 22 taken 39 times.
✓ Branch 23 → 24 taken 503 times.
✓ Branch 23 → 35 taken 896 times.
|
1399 | if (!uid.isEmpty() && isUuid(uid)) { |
| 122 |
2/2✓ Branch 24 → 25 taken 503 times.
✓ Branch 28 → 29 taken 503 times.
|
1006 | property->value = QStringLiteral("urn:uuid:") + uid.toLower(); |
| 123 | 503 | return; | |
| 124 | } | ||
| 125 |
2/2✓ Branch 36 → 37 taken 3 times.
✓ Branch 36 → 39 taken 893 times.
|
896 | if (!uri.isEmpty()) { |
| 126 | 3 | property->value = uri; | |
| 127 | 3 | return; | |
| 128 | } | ||
| 129 | 1786 | property->parameters.append({QStringLiteral("VALUE"), QStringLiteral("text")}); | |
| 130 |
2/2✓ Branch 50 → 51 taken 39 times.
✓ Branch 50 → 59 taken 854 times.
|
893 | if (!uid.isEmpty()) |
| 131 | 78 | property->parameters.append({QStringLiteral("X-MAILJD-UID"), uid}); | |
| 132 |
1/1✓ Branch 59 → 60 taken 893 times.
|
893 | property->value = ICal::escapeText(name); |
| 133 | 1833 | } | |
| 134 | |||
| 135 | 947 | int writeRelation(Writer *w, int position, const ContactRelation &relation, bool apple) { | |
| 136 |
1/1✓ Branch 2 → 3 taken 947 times.
|
947 | const QString type = RelationVocabulary::canonical(relation.type); |
| 137 |
1/2✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 947 times.
|
947 | if (relation.readOnly()) |
| 138 | ✗ | return position; // legacy relations are never written | |
| 139 |
6/6✓ Branch 8 → 9 taken 946 times.
✓ Branch 8 → 12 taken 1 time.
✓ Branch 10 → 11 taken 939 times.
✓ Branch 10 → 13 taken 7 times.
✓ Branch 11 → 12 taken 9 times.
✓ Branch 11 → 13 taken 930 times.
|
947 | const bool useApple = relation.model == QLatin1String("apple") || (relation.model.isEmpty() && apple); |
| 140 |
6/6✓ Branch 16 → 17 taken 10 times.
✓ Branch 16 → 20 taken 937 times.
✓ Branch 25 → 26 taken 937 times.
✓ Branch 25 → 27 taken 10 times.
✓ Branch 27 → 28 taken 10 times.
✓ Branch 27 → 29 taken 937 times.
|
1894 | ICal::Property property = make(useApple ? QStringLiteral("X-ABRELATEDNAMES") : QStringLiteral("RELATED"), {}); |
| 141 | 947 | QString label; | |
| 142 |
2/2✓ Branch 31 → 32 taken 10 times.
✓ Branch 31 → 46 taken 937 times.
|
947 | if (useApple) { |
| 143 |
7/11✓ Branch 34 → 35 taken 1 time.
✓ Branch 34 → 36 taken 9 times.
✓ Branch 38 → 39 taken 9 times.
✓ Branch 41 → 42 taken 9 times.
✓ Branch 41 → 43 taken 1 time.
✓ Branch 43 → 44 taken 9 times.
✓ Branch 43 → 45 taken 1 time.
✗ Branch 111 → 112 not taken.
✗ Branch 111 → 113 not taken.
✗ Branch 115 → 116 not taken.
✗ Branch 115 → 117 not taken.
|
10 | label = type == QLatin1String("custom") ? relation.label : RelationVocabulary::label(type); |
| 144 | } else { | ||
| 145 |
1/1✓ Branch 46 → 47 taken 937 times.
|
937 | const QString wire = RelationVocabulary::wireType(type); |
| 146 | 937 | property.parameters.append({QStringLiteral("TYPE"), w->v4 ? wire : wire.toUpper()}); | |
| 147 |
3/3✓ Branch 56 → 57 taken 937 times.
✓ Branch 57 → 58 taken 117 times.
✓ Branch 57 → 73 taken 820 times.
|
937 | if (RelationVocabulary::isKinSubtype(type)) { |
| 148 | 117 | property.parameters.append({QStringLiteral("X-MAILJD-KIN"), type}); | |
| 149 |
1/1✓ Branch 67 → 68 taken 117 times.
|
117 | label = RelationVocabulary::label(type); |
| 150 |
2/2✓ Branch 75 → 76 taken 12 times.
✓ Branch 75 → 77 taken 808 times.
|
820 | } else if (type == QLatin1String("custom")) { |
| 151 | 12 | label = relation.label; | |
| 152 | } | ||
| 153 | 937 | } | |
| 154 | // S106-172: a custom label that is also a known word ("Mother") is marked, | ||
| 155 | // so reading it back keeps the user's custom type. | ||
| 156 |
9/11✓ Branch 81 → 82 taken 13 times.
✓ Branch 81 → 86 taken 934 times.
✓ Branch 82 → 83 taken 13 times.
✓ Branch 84 → 85 taken 2 times.
✓ Branch 84 → 86 taken 11 times.
✓ Branch 87 → 88 taken 13 times.
✓ Branch 87 → 89 taken 934 times.
✓ Branch 89 → 90 taken 2 times.
✓ Branch 89 → 101 taken 945 times.
✗ Branch 149 → 150 not taken.
✗ Branch 149 → 151 not taken.
|
947 | if (type == QLatin1String("custom") && !RelationVocabulary::typeForLabel(label).isEmpty()) |
| 157 | 2 | property.parameters.append({QStringLiteral("X-MAILJD-KIN"), QStringLiteral("custom")}); | |
| 158 |
1/1✓ Branch 101 → 102 taken 947 times.
|
947 | addTarget(&property, relation.targetUri, relation.targetUid, relation.targetName, useApple); |
| 159 |
1/1✓ Branch 103 → 104 taken 947 times.
|
947 | return insertGrouped(w, position, property, label); |
| 160 | 2005 | } | |
| 161 | |||
| 162 | 26452 | void applyRelations(Writer *w, const ContactCard &before, const ContactCard &after) { | |
| 163 |
2/2✓ Branch 3 → 4 taken 25718 times.
✓ Branch 3 → 5 taken 734 times.
|
26452 | if (before.relations == after.relations) |
| 164 | 25718 | return; | |
| 165 | 734 | const bool apple = appleModel(w->card); | |
| 166 |
2/4✓ Branch 16 → 17 taken 1468 times.
✓ Branch 16 → 18 taken 734 times.
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 27 not taken.
|
2202 | patchList( |
| 167 |
1/1✓ Branch 13 → 14 taken 734 times.
|
734 | w, before.relations, after.relations, |
| 168 | 734 | {QStringLiteral("RELATED"), QStringLiteral("X-ABRELATEDNAMES")}, | |
| 169 | 824 | [](const ContactRelation &a, const ContactRelation &b) { return a == b; }, | |
| 170 | 947 | [w, apple](int position, const ContactRelation &relation) { | |
| 171 | 947 | return writeRelation(w, position, relation, apple); | |
| 172 | }); | ||
| 173 | 2202 | } | |
| 174 | |||
| 175 | // ─── how we met (D-7) ─── | ||
| 176 | |||
| 177 | 145 | QString looseWire(const LooseDate &date, bool v4, bool *omitYear) { | |
| 178 | 145 | *omitYear = false; | |
| 179 |
2/2✓ Branch 3 → 4 taken 103 times.
✓ Branch 3 → 5 taken 42 times.
|
145 | if (!date.hasDay()) |
| 180 | 103 | return {}; | |
| 181 | 42 | const PartialDate full{date.year, date.month, date.day}; | |
| 182 |
4/4✓ Branch 5 → 6 taken 40 times.
✓ Branch 5 → 8 taken 2 times.
✓ Branch 6 → 7 taken 1 time.
✓ Branch 6 → 8 taken 39 times.
|
42 | *omitYear = !v4 && date.year <= 0; |
| 183 |
1/1✓ Branch 9 → 10 taken 42 times.
|
42 | return dateWire(full, v4); |
| 184 | } | ||
| 185 | |||
| 186 | 462 | int writeIntroducer(Writer *w, int position, const ContactPersonRef &ref, bool apple) { | |
| 187 | ICal::Property property = | ||
| 188 |
3/6✗ Branch 4 → 5 not taken.
✓ Branch 4 → 8 taken 462 times.
✓ Branch 13 → 14 taken 462 times.
✗ Branch 13 → 15 not taken.
✗ Branch 15 → 16 not taken.
✓ Branch 15 → 17 taken 462 times.
|
924 | make(apple ? QStringLiteral("X-ABRELATEDNAMES") : QStringLiteral("RELATED"), {}); |
| 189 |
1/2✓ Branch 19 → 20 taken 462 times.
✗ Branch 19 → 38 not taken.
|
462 | if (!apple) |
| 190 |
4/8✓ Branch 32 → 33 taken 342 times.
✓ Branch 32 → 34 taken 120 times.
✓ Branch 34 → 35 taken 120 times.
✓ Branch 34 → 36 taken 342 times.
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 62 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
|
462 | property.parameters.append({QStringLiteral("TYPE"), w->v4 ? QStringLiteral("contact") : QStringLiteral("CONTACT")}); |
| 191 | 462 | property.parameters.append({QStringLiteral("X-MAILJD-ROLE"), QStringLiteral("met-via")}); | |
| 192 |
1/1✓ Branch 48 → 49 taken 462 times.
|
462 | addTarget(&property, ref.uri, ref.uid, ref.name, apple); |
| 193 |
2/2✓ Branch 49 → 50 taken 462 times.
✓ Branch 51 → 52 taken 462 times.
|
924 | return insertGrouped(w, position, property, RelationVocabulary::metViaLabel()); |
| 194 | 2310 | } | |
| 195 | |||
| 196 | 145 | int metDateIndex(const Writer &w) { | |
| 197 |
2/2✓ Branch 37 → 3 taken 1965 times.
✓ Branch 37 → 38 taken 139 times.
|
2104 | for (int i = 0; i < w.card.properties.size(); ++i) { |
| 198 | 1965 | const ICal::Property &property = w.card.properties.at(i); | |
| 199 |
3/3✓ Branch 5 → 6 taken 1965 times.
✓ Branch 8 → 9 taken 1955 times.
✓ Branch 8 → 10 taken 10 times.
|
1965 | if (baseName(property) != QLatin1String("X-ABDATE")) |
| 200 | 1955 | continue; | |
| 201 |
3/3✓ Branch 13 → 14 taken 10 times.
✓ Branch 19 → 20 taken 4 times.
✓ Branch 19 → 21 taken 6 times.
|
10 | if (property.parameter(QStringLiteral("X-MAILJD-ROLE")).compare(QLatin1String("met"), Qt::CaseInsensitive) == 0) |
| 202 | 4 | return i; | |
| 203 |
2/2✓ Branch 21 → 22 taken 6 times.
✓ Branch 22 → 23 taken 6 times.
|
6 | const int label = labelIndex(w.card, groupOf(property)); |
| 204 |
8/12✓ Branch 24 → 25 taken 6 times.
✗ Branch 24 → 30 not taken.
✓ Branch 26 → 27 taken 6 times.
✓ Branch 27 → 28 taken 6 times.
✓ Branch 28 → 29 taken 2 times.
✓ Branch 28 → 30 taken 4 times.
✓ Branch 31 → 32 taken 6 times.
✗ Branch 31 → 33 not taken.
✓ Branch 33 → 34 taken 2 times.
✓ Branch 33 → 35 taken 4 times.
✗ Branch 52 → 53 not taken.
✗ Branch 52 → 54 not taken.
|
6 | if (label >= 0 && RelationVocabulary::isMetDateLabel(ICal::unescapeText(w.card.properties.at(label).value))) |
| 205 | 2 | return i; | |
| 206 | } | ||
| 207 | 139 | return -1; | |
| 208 | } | ||
| 209 | |||
| 210 | 145 | void writeMetDate(Writer *w, const LooseDate &date) { | |
| 211 |
1/1✓ Branch 2 → 3 taken 145 times.
|
145 | int position = metDateIndex(*w); |
| 212 |
2/2✓ Branch 3 → 4 taken 6 times.
✓ Branch 3 → 5 taken 139 times.
|
145 | if (position >= 0) |
| 213 |
1/1✓ Branch 4 → 5 taken 6 times.
|
6 | removeWithGroup(w, position); |
| 214 |
1/1✓ Branch 8 → 9 taken 145 times.
|
145 | const int plain = indexOfName(w->card, QStringLiteral("X-MAILJD-MET-DATE")); |
| 215 |
2/2✓ Branch 11 → 12 taken 3 times.
✓ Branch 11 → 16 taken 142 times.
|
145 | if (plain >= 0) { |
| 216 |
1/2✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 3 times.
|
3 | position = position < 0 ? plain : position; |
| 217 |
1/1✓ Branch 15 → 16 taken 3 times.
|
3 | w->removeAt(plain); |
| 218 | } | ||
| 219 |
2/3✓ Branch 16 → 17 taken 145 times.
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 19 taken 145 times.
|
145 | if (!date.isValid()) |
| 220 | 103 | return; | |
| 221 |
2/2✓ Branch 19 → 20 taken 136 times.
✓ Branch 19 → 35 taken 9 times.
|
145 | if (position < 0) |
| 222 |
3/5✓ Branch 27 → 28 taken 136 times.
✓ Branch 30 → 31 taken 272 times.
✓ Branch 30 → 32 taken 136 times.
✗ Branch 102 → 103 not taken.
✗ Branch 102 → 104 not taken.
|
408 | position = insertionPoint(*w, {QStringLiteral("X-ABDATE"), QStringLiteral("BDAY")}); |
| 223 | 145 | bool omitYear = false; | |
| 224 |
1/1✓ Branch 35 → 36 taken 145 times.
|
145 | const QString wire = looseWire(date, w->v4, &omitYear); |
| 225 |
2/2✓ Branch 37 → 38 taken 103 times.
✓ Branch 37 → 51 taken 42 times.
|
145 | if (wire.isEmpty()) { |
| 226 | // A year or a month cannot be an X-ABDATE (D-7). | ||
| 227 |
2/2✓ Branch 39 → 40 taken 103 times.
✓ Branch 44 → 45 taken 103 times.
|
206 | w->insert(position, make(QStringLiteral("X-MAILJD-MET-DATE"), date.toIso())); |
| 228 | 103 | return; | |
| 229 | } | ||
| 230 |
2/4✓ Branch 59 → 60 taken 42 times.
✓ Branch 59 → 61 taken 42 times.
✗ Branch 134 → 135 not taken.
✗ Branch 134 → 136 not taken.
|
84 | QList<ICal::Parameter> parameters{{QStringLiteral("X-MAILJD-ROLE"), QStringLiteral("met")}}; |
| 231 |
2/2✓ Branch 63 → 64 taken 1 time.
✓ Branch 63 → 75 taken 41 times.
|
42 | if (omitYear) |
| 232 | 1 | parameters.append({QStringLiteral("X-APPLE-OMIT-YEAR"), QStringLiteral("1604")}); | |
| 233 |
2/2✓ Branch 75 → 76 taken 42 times.
✓ Branch 80 → 81 taken 42 times.
|
84 | insertGrouped(w, position, make(QStringLiteral("X-ABDATE"), wire, parameters), RelationVocabulary::metDateLabel()); |
| 234 | 681 | } | |
| 235 | |||
| 236 | // Sets, changes or removes the single property `name`; `parameters` are | ||
| 237 | // written only with a new or changed value. | ||
| 238 | 361 | void setPlain(Writer *w, const QString &name, const QString &value, const QList<ICal::Parameter> ¶meters = {}) { | |
| 239 | 361 | const int index = indexOfName(w->card, name); | |
| 240 |
2/2✓ Branch 3 → 4 taken 13 times.
✓ Branch 3 → 5 taken 348 times.
|
361 | if (index >= 0) |
| 241 | 13 | w->removeAt(index); | |
| 242 |
1/2✗ Branch 6 → 7 not taken.
✓ Branch 6 → 8 taken 361 times.
|
361 | if (value.isEmpty()) |
| 243 | ✗ | return; | |
| 244 | 361 | int position = index; | |
| 245 |
2/2✓ Branch 8 → 9 taken 348 times.
✓ Branch 8 → 40 taken 13 times.
|
361 | if (position < 0) |
| 246 |
3/5✓ Branch 28 → 29 taken 348 times.
✓ Branch 31 → 32 taken 2088 times.
✓ Branch 31 → 33 taken 348 times.
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 52 not taken.
|
2784 | position = insertionPoint(*w, {QStringLiteral("X-MAILJD-MET-DATE"), QStringLiteral("X-MAILJD-MET-PLACE"), |
| 247 | 348 | QStringLiteral("X-MAILJD-MET-EVENT"), QStringLiteral("X-MAILJD-MET-NOTE"), | |
| 248 | 348 | QStringLiteral("X-ABDATE"), QStringLiteral("RELATED")}); | |
| 249 |
2/2✓ Branch 40 → 41 taken 361 times.
✓ Branch 42 → 43 taken 361 times.
|
361 | w->insert(position, make(name, ICal::escapeText(value), parameters)); |
| 250 | 2436 | } | |
| 251 | |||
| 252 | 26452 | void applyMet(Writer *w, const ContactCard &before, const ContactCard &after) { | |
| 253 | 26452 | const ContactMet &old = before.met; | |
| 254 | 26452 | const ContactMet &met = after.met; | |
| 255 |
2/2✓ Branch 3 → 4 taken 25885 times.
✓ Branch 3 → 5 taken 567 times.
|
26452 | if (old == met) |
| 256 | 25885 | return; | |
| 257 |
2/2✓ Branch 6 → 7 taken 145 times.
✓ Branch 6 → 8 taken 422 times.
|
567 | if (old.date != met.date) |
| 258 | 145 | writeMetDate(w, met.date); | |
| 259 |
2/2✓ Branch 9 → 10 taken 464 times.
✓ Branch 9 → 26 taken 103 times.
|
567 | if (old.via != met.via) { |
| 260 | 464 | const bool apple = appleModel(w->card); | |
| 261 |
2/4✓ Branch 21 → 22 taken 928 times.
✓ Branch 21 → 23 taken 464 times.
✗ Branch 87 → 88 not taken.
✗ Branch 87 → 89 not taken.
|
1392 | patchList( |
| 262 |
1/1✓ Branch 18 → 19 taken 464 times.
|
928 | w, old.via, met.via, {QStringLiteral("RELATED"), QStringLiteral("X-ABRELATEDNAMES")}, |
| 263 | 234 | [](const ContactPersonRef &a, const ContactPersonRef &b) { return a == b; }, | |
| 264 | 462 | [w, apple](int position, const ContactPersonRef &ref) { return writeIntroducer(w, position, ref, apple); }); | |
| 265 | } | ||
| 266 |
5/6✓ Branch 27 → 28 taken 433 times.
✓ Branch 27 → 30 taken 134 times.
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 31 taken 433 times.
✓ Branch 32 → 33 taken 134 times.
✓ Branch 32 → 50 taken 433 times.
|
567 | if (old.place != met.place || old.placeGeo != met.placeGeo) { |
| 267 | 134 | QList<ICal::Parameter> parameters; | |
| 268 |
2/2✓ Branch 33 → 34 taken 4 times.
✓ Branch 33 → 42 taken 130 times.
|
134 | if (met.placeGeo.valid) |
| 269 | 4 | parameters.append({QStringLiteral("GEO"), met.placeGeo.toUri()}); | |
| 270 |
1/1✓ Branch 45 → 46 taken 134 times.
|
268 | setPlain(w, QStringLiteral("X-MAILJD-MET-PLACE"), met.place, parameters); |
| 271 | 134 | } | |
| 272 |
2/2✓ Branch 51 → 52 taken 12 times.
✓ Branch 51 → 61 taken 555 times.
|
567 | if (old.eventUid != met.eventUid) |
| 273 |
1/1✓ Branch 56 → 57 taken 12 times.
|
24 | setPlain(w, QStringLiteral("X-MAILJD-MET-EVENT"), met.eventUid); |
| 274 |
2/2✓ Branch 62 → 63 taken 112 times.
✓ Branch 62 → 72 taken 455 times.
|
567 | if (old.note != met.note) |
| 275 |
1/1✓ Branch 67 → 68 taken 112 times.
|
224 | setPlain(w, QStringLiteral("X-MAILJD-MET-NOTE"), met.note); |
| 276 |
2/2✓ Branch 73 → 74 taken 9 times.
✓ Branch 73 → 83 taken 558 times.
|
567 | if (old.channel != met.channel) |
| 277 |
1/1✓ Branch 78 → 79 taken 9 times.
|
18 | setPlain(w, QStringLiteral("X-MAILJD-MET-CHANNEL"), met.channel); |
| 278 | 1396 | } | |
| 279 | |||
| 280 | // ─── social profiles and chat (D-8) ─── | ||
| 281 | |||
| 282 | 618 | int writeSocial(Writer *w, int position, const ContactSocial &social) { | |
| 283 | 618 | QString name = social.property; | |
| 284 |
1/2✓ Branch 4 → 5 taken 618 times.
✗ Branch 4 → 27 not taken.
|
618 | if (name.isEmpty()) |
| 285 |
2/2✓ Branch 7 → 8 taken 58 times.
✓ Branch 7 → 11 taken 560 times.
|
2472 | name = social.kind == QLatin1String("chat") ? QStringLiteral("IMPP") |
| 286 |
4/4✓ Branch 11 → 12 taken 143 times.
✓ Branch 11 → 15 taken 417 times.
✓ Branch 24 → 25 taken 58 times.
✓ Branch 24 → 26 taken 560 times.
|
1178 | : w->v4 ? QStringLiteral("SOCIALPROFILE") |
| 287 |
4/4✓ Branch 20 → 21 taken 417 times.
✓ Branch 20 → 22 taken 201 times.
✓ Branch 22 → 23 taken 143 times.
✓ Branch 22 → 24 taken 475 times.
|
1236 | : QStringLiteral("X-SOCIALPROFILE"); |
| 288 | 618 | ICal::Property property = make(name, {}); | |
| 289 |
1/1✓ Branch 32 → 33 taken 618 times.
|
618 | const QString service = social.service.toLower(); |
| 290 |
2/2✓ Branch 35 → 36 taken 58 times.
✓ Branch 35 → 56 taken 560 times.
|
618 | if (name == QLatin1String("IMPP")) { |
| 291 |
8/12✓ Branch 37 → 38 taken 58 times.
✗ Branch 37 → 44 not taken.
✓ Branch 40 → 41 taken 58 times.
✓ Branch 41 → 42 taken 58 times.
✓ Branch 42 → 43 taken 27 times.
✓ Branch 42 → 44 taken 31 times.
✓ Branch 45 → 46 taken 58 times.
✗ Branch 45 → 47 not taken.
✓ Branch 47 → 48 taken 27 times.
✓ Branch 47 → 119 taken 31 times.
✗ Branch 136 → 137 not taken.
✗ Branch 136 → 138 not taken.
|
58 | if (!service.isEmpty() && !social.value.startsWith(service + QLatin1Char(':'), Qt::CaseInsensitive)) |
| 292 | 27 | property.parameters.append({QStringLiteral("X-SERVICE-TYPE"), service}); | |
| 293 |
2/2✓ Branch 58 → 59 taken 417 times.
✓ Branch 58 → 79 taken 143 times.
|
560 | } else if (name == QLatin1String("X-SOCIALPROFILE")) { |
| 294 |
2/2✓ Branch 60 → 61 taken 123 times.
✓ Branch 60 → 69 taken 294 times.
|
417 | if (!service.isEmpty()) |
| 295 | 123 | property.parameters.append({QStringLiteral("TYPE"), service}); | |
| 296 |
2/2✓ Branch 70 → 71 taken 74 times.
✓ Branch 70 → 119 taken 343 times.
|
417 | if (!social.user.isEmpty()) |
| 297 | 74 | property.parameters.append({QStringLiteral("X-USER"), social.user}); | |
| 298 | } else { | ||
| 299 |
2/2✓ Branch 80 → 81 taken 24 times.
✓ Branch 80 → 89 taken 119 times.
|
143 | if (!service.isEmpty()) |
| 300 | 24 | property.parameters.append({QStringLiteral("SERVICE-TYPE"), service}); | |
| 301 |
2/2✓ Branch 90 → 91 taken 1 time.
✓ Branch 90 → 99 taken 142 times.
|
143 | if (!social.user.isEmpty()) |
| 302 | 1 | property.parameters.append({QStringLiteral("USERNAME"), social.user}); | |
| 303 |
6/7✓ Branch 100 → 101 taken 24 times.
✓ Branch 100 → 105 taken 119 times.
✓ Branch 103 → 104 taken 24 times.
✗ Branch 104 → 105 not taken.
✓ Branch 104 → 106 taken 24 times.
✓ Branch 107 → 108 taken 119 times.
✓ Branch 107 → 119 taken 24 times.
|
143 | if (social.value.isEmpty() || !social.value.contains(QLatin1Char(':'))) |
| 304 | 119 | property.parameters.append({QStringLiteral("VALUE"), QStringLiteral("text")}); | |
| 305 | } | ||
| 306 |
3/3✓ Branch 120 → 121 taken 413 times.
✓ Branch 120 → 122 taken 205 times.
✓ Branch 123 → 124 taken 618 times.
|
618 | property.value = ICal::escapeText(social.value.isEmpty() ? social.user : social.value); |
| 307 |
2/2✓ Branch 127 → 128 taken 413 times.
✓ Branch 127 → 129 taken 205 times.
|
618 | if (property.value.isEmpty()) |
| 308 | 413 | return position; | |
| 309 |
1/1✓ Branch 129 → 130 taken 205 times.
|
205 | w->insert(position, property); |
| 310 | 205 | return position + 1; | |
| 311 | 1105 | } | |
| 312 | |||
| 313 | 26452 | void applySocial(Writer *w, const ContactCard &before, const ContactCard &after) { | |
| 314 |
2/2✓ Branch 3 → 4 taken 25863 times.
✓ Branch 3 → 5 taken 589 times.
|
26452 | if (before.social == after.social) |
| 315 | 25863 | return; | |
| 316 | 589 | patchList( | |
| 317 | 589 | w, before.social, after.social, kSocialNames, | |
| 318 | 340 | [](const ContactSocial &a, const ContactSocial &b) { return a == b; }, | |
| 319 | 618 | [w](int position, const ContactSocial &social) { return writeSocial(w, position, social); }); | |
| 320 | } | ||
| 321 | |||
| 322 | // ─── languages, interests, other dates, birthplace, positions ─── | ||
| 323 | |||
| 324 | // Value-set patch of LANG / INTEREST: lines whose value stays are kept, | ||
| 325 | // removed values go, new ones are appended. Languages get PREF by position | ||
| 326 | // when there are several (D-9). | ||
| 327 | 52904 | void applyValueSet(Writer *w, const QStringList &before, const QStringList &after, const QSet<QString> &names, | |
| 328 | const QString &writeName, bool ranked) { | ||
| 329 |
3/3✓ Branch 2 → 3 taken 52904 times.
✓ Branch 3 → 4 taken 52708 times.
✓ Branch 3 → 5 taken 196 times.
|
52904 | if (before == after) |
| 330 | 52810 | return; | |
| 331 | 196 | QStringList remaining = after; | |
| 332 |
2/2✓ Branch 24 → 8 taken 3326 times.
✓ Branch 24 → 25 taken 196 times.
|
3522 | for (int i = int(w->card.properties.size()) - 1; i >= 0; --i) { |
| 333 | 3326 | const ICal::Property &property = w->card.properties.at(i); | |
| 334 |
3/3✓ Branch 9 → 10 taken 3326 times.
✓ Branch 12 → 13 taken 3306 times.
✓ Branch 12 → 14 taken 20 times.
|
3326 | if (!names.contains(baseName(property))) |
| 335 | 3306 | continue; | |
| 336 |
2/2✓ Branch 14 → 15 taken 20 times.
✓ Branch 15 → 16 taken 20 times.
|
20 | const QString value = ICal::unescapeText(property.value).trimmed(); |
| 337 |
2/2✓ Branch 18 → 19 taken 17 times.
✓ Branch 18 → 20 taken 3 times.
|
20 | if (remaining.contains(value)) |
| 338 |
1/1✓ Branch 19 → 21 taken 17 times.
|
17 | remaining.removeOne(value); |
| 339 | else | ||
| 340 |
1/1✓ Branch 20 → 21 taken 3 times.
|
3 | w->removeAt(i); |
| 341 | 20 | } | |
| 342 |
1/1✓ Branch 25 → 26 taken 196 times.
|
196 | int position = insertionPoint(*w, names); |
| 343 |
4/4✓ Branch 26 → 27 taken 196 times.
✓ Branch 27 → 28 taken 196 times.
✓ Branch 39 → 29 taken 250 times.
✓ Branch 39 → 40 taken 196 times.
|
446 | for (const QString &value : remaining) |
| 344 |
2/2✓ Branch 31 → 32 taken 250 times.
✓ Branch 33 → 34 taken 250 times.
|
250 | w->insert(position++, make(writeName, ICal::escapeText(value))); |
| 345 |
2/2✓ Branch 40 → 41 taken 102 times.
✓ Branch 40 → 42 taken 94 times.
|
196 | if (!ranked) |
| 346 | 102 | return; | |
| 347 |
4/4✓ Branch 42 → 43 taken 94 times.
✓ Branch 43 → 44 taken 94 times.
✓ Branch 97 → 45 taken 1727 times.
✓ Branch 97 → 98 taken 94 times.
|
1821 | for (ICal::Property &property : w->card.properties) { |
| 348 |
3/3✓ Branch 46 → 47 taken 1727 times.
✓ Branch 49 → 50 taken 1597 times.
✓ Branch 49 → 51 taken 130 times.
|
1727 | if (!names.contains(baseName(property))) |
| 349 | 1669 | continue; | |
| 350 |
2/2✓ Branch 51 → 52 taken 130 times.
✓ Branch 52 → 53 taken 130 times.
|
130 | const int rank = int(after.indexOf(ICal::unescapeText(property.value).trimmed())) + 1; |
| 351 |
4/5✓ Branch 57 → 58 taken 61 times.
✓ Branch 57 → 61 taken 69 times.
✓ Branch 58 → 59 taken 61 times.
✗ Branch 58 → 61 not taken.
✓ Branch 59 → 60 taken 61 times.
|
130 | const QString pref = after.size() > 1 && rank > 0 ? QString::number(rank) : QString(); |
| 352 |
3/3✓ Branch 65 → 66 taken 130 times.
✓ Branch 70 → 71 taken 72 times.
✓ Branch 70 → 72 taken 58 times.
|
130 | if (property.parameter(QStringLiteral("PREF")) == pref) |
| 353 | 72 | continue; | |
| 354 |
1/2✗ Branch 73 → 74 not taken.
✓ Branch 73 → 81 taken 58 times.
|
58 | if (pref.isEmpty()) |
| 355 | ✗ | property.removeParameter(QStringLiteral("PREF")); | |
| 356 | else | ||
| 357 |
1/1✓ Branch 84 → 85 taken 58 times.
|
58 | property.setParameter(QStringLiteral("PREF"), pref); |
| 358 | 58 | property.originalLine.clear(); | |
| 359 | 130 | } | |
| 360 | 196 | } | |
| 361 | |||
| 362 | 94 | int writeOtherDate(Writer *w, int position, const ContactDate &date) { | |
| 363 |
1/2✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 94 times.
|
94 | if (!date.date.isValid()) |
| 364 | ✗ | return position; | |
| 365 | 94 | QList<ICal::Parameter> parameters; | |
| 366 |
6/6✓ Branch 5 → 6 taken 68 times.
✓ Branch 5 → 9 taken 26 times.
✓ Branch 7 → 8 taken 10 times.
✓ Branch 7 → 9 taken 58 times.
✓ Branch 10 → 11 taken 10 times.
✓ Branch 10 → 22 taken 84 times.
|
94 | if (!w->v4 && !date.date.hasYear()) |
| 367 | 10 | parameters.append({QStringLiteral("X-APPLE-OMIT-YEAR"), QStringLiteral("1604")}); | |
| 368 |
1/1✓ Branch 27 → 28 taken 94 times.
|
188 | return insertGrouped(w, position, make(QStringLiteral("X-ABDATE"), dateWire(date.date, w->v4), parameters), |
| 369 |
1/1✓ Branch 22 → 23 taken 94 times.
|
188 | date.label); |
| 370 | 114 | } | |
| 371 | |||
| 372 | 26452 | void applyPersonal(Writer *w, const ContactCard &before, const ContactCard &after) { | |
| 373 |
4/4✓ Branch 2 → 3 taken 1148 times.
✓ Branch 2 → 4 taken 25304 times.
✓ Branch 7 → 8 taken 25304 times.
✓ Branch 7 → 9 taken 1148 times.
|
51756 | const QString x = w->v4 ? QString() : QStringLiteral("X-MAILJD-"); |
| 374 |
3/5✓ Branch 20 → 21 taken 26452 times.
✓ Branch 23 → 24 taken 52904 times.
✓ Branch 23 → 25 taken 26452 times.
✗ Branch 152 → 153 not taken.
✗ Branch 152 → 154 not taken.
|
79356 | applyValueSet(w, before.languages, after.languages, {QStringLiteral("LANG"), QStringLiteral("X-MAILJD-LANG")}, |
| 375 |
1/1✓ Branch 12 → 13 taken 26452 times.
|
52904 | x + QStringLiteral("LANG"), true); |
| 376 |
3/5✓ Branch 47 → 48 taken 26452 times.
✓ Branch 50 → 51 taken 105808 times.
✓ Branch 50 → 52 taken 26452 times.
✗ Branch 180 → 181 not taken.
✗ Branch 180 → 182 not taken.
|
132260 | applyValueSet(w, before.interests, after.interests, |
| 377 | 26452 | {QStringLiteral("INTEREST"), QStringLiteral("X-MAILJD-INTEREST"), QStringLiteral("HOBBY"), | |
| 378 | 26452 | QStringLiteral("EXPERTISE")}, | |
| 379 |
1/1✓ Branch 33 → 34 taken 26452 times.
|
52904 | x + QStringLiteral("INTEREST"), false); |
| 380 |
3/3✓ Branch 59 → 60 taken 26452 times.
✓ Branch 60 → 61 taken 94 times.
✓ Branch 60 → 72 taken 26358 times.
|
26452 | if (before.otherDates != after.otherDates) |
| 381 |
2/4✓ Branch 68 → 69 taken 94 times.
✓ Branch 68 → 70 taken 94 times.
✗ Branch 214 → 215 not taken.
✗ Branch 214 → 216 not taken.
|
188 | patchList( |
| 382 |
1/1✓ Branch 65 → 66 taken 94 times.
|
188 | w, before.otherDates, after.otherDates, {QStringLiteral("X-ABDATE")}, |
| 383 | 6 | [](const ContactDate &a, const ContactDate &b) { return a == b; }, | |
| 384 | 94 | [w](int position, const ContactDate &date) { return writeOtherDate(w, position, date); }); | |
| 385 |
2/2✓ Branch 73 → 74 taken 94 times.
✓ Branch 73 → 104 taken 26358 times.
|
26452 | if (before.birthplace != after.birthplace) { |
| 386 |
1/1✓ Branch 77 → 78 taken 94 times.
|
94 | const bool rfc = indexOfName(w->card, QStringLiteral("BIRTHPLACE")) >= 0; |
| 387 |
1/1✓ Branch 83 → 84 taken 94 times.
|
94 | const int other = indexOfName(w->card, QStringLiteral("X-MAILJD-BIRTHPLACE")); |
| 388 |
9/10✓ Branch 86 → 87 taken 93 times.
✓ Branch 86 → 89 taken 1 time.
✓ Branch 87 → 88 taken 24 times.
✓ Branch 87 → 92 taken 69 times.
✓ Branch 88 → 89 taken 24 times.
✗ Branch 88 → 92 not taken.
✓ Branch 95 → 96 taken 69 times.
✓ Branch 95 → 97 taken 25 times.
✓ Branch 97 → 98 taken 25 times.
✓ Branch 97 → 99 taken 69 times.
|
188 | const QString name = rfc || (w->v4 && other < 0) ? QStringLiteral("BIRTHPLACE") : QStringLiteral("X-MAILJD-BIRTHPLACE"); |
| 389 |
1/1✓ Branch 100 → 101 taken 94 times.
|
94 | setPlain(w, name, after.birthplace); |
| 390 | 94 | } | |
| 391 |
2/2✓ Branch 105 → 106 taken 2 times.
✓ Branch 105 → 147 taken 26450 times.
|
26452 | if (before.geo != after.geo) { |
| 392 |
1/1✓ Branch 109 → 110 taken 2 times.
|
2 | const int index = indexOfName(w->card, QStringLiteral("GEO")); |
| 393 |
1/2✗ Branch 112 → 113 not taken.
✓ Branch 112 → 114 taken 2 times.
|
2 | if (index >= 0) |
| 394 | ✗ | w->removeAt(index); | |
| 395 |
1/2✓ Branch 114 → 115 taken 2 times.
✗ Branch 114 → 147 not taken.
|
2 | if (after.geo.valid) { |
| 396 | 2 | const QString wire = w->v4 ? after.geo.toUri() | |
| 397 |
4/10✓ Branch 123 → 124 taken 1 time.
✓ Branch 123 → 125 taken 1 time.
✓ Branch 129 → 130 taken 1 time.
✓ Branch 129 → 131 taken 1 time.
✗ Branch 251 → 252 not taken.
✗ Branch 251 → 253 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 259 → 261 not taken.
✗ Branch 263 → 264 not taken.
✗ Branch 263 → 265 not taken.
|
5 | : QStringLiteral("%1;%2").arg(QString::number(after.geo.latitude, 'g', 9), |
| 398 |
10/12✓ Branch 115 → 116 taken 1 time.
✓ Branch 115 → 117 taken 1 time.
✓ Branch 116 → 123 taken 1 time.
✓ Branch 120 → 121 taken 1 time.
✓ Branch 121 → 122 taken 1 time.
✓ Branch 122 → 123 taken 1 time.
✓ Branch 125 → 126 taken 1 time.
✓ Branch 125 → 127 taken 1 time.
✓ Branch 127 → 128 taken 1 time.
✓ Branch 127 → 129 taken 1 time.
✗ Branch 255 → 256 not taken.
✗ Branch 255 → 257 not taken.
|
5 | QString::number(after.geo.longitude, 'g', 9)); |
| 399 |
2/3✓ Branch 136 → 137 taken 2 times.
✗ Branch 136 → 139 not taken.
✓ Branch 140 → 141 taken 2 times.
|
4 | w->insert(index < 0 ? int(w->card.properties.size()) : index, make(QStringLiteral("GEO"), wire)); |
| 400 | 2 | } | |
| 401 | } | ||
| 402 | 238256 | } | |
| 403 | |||
| 404 | // ─── gender (F103-41) ─── | ||
| 405 | |||
| 406 | // The sex component in the form the stored line uses: older 3.0 clients | ||
| 407 | // write words into X-GENDER ("Female"), RFC 6350 §6.2.7 the letter. | ||
| 408 | 9 | QString genderWire(const QString &sex, bool word) { | |
| 409 |
2/2✓ Branch 2 → 3 taken 7 times.
✓ Branch 2 → 4 taken 2 times.
|
9 | if (!word) |
| 410 | 7 | return sex; | |
| 411 |
1/2✗ Branch 6 → 7 not taken.
✓ Branch 6 → 12 taken 2 times.
|
2 | if (sex == QLatin1String("F")) |
| 412 | ✗ | return QStringLiteral("Female"); | |
| 413 |
2/2✓ Branch 14 → 15 taken 1 time.
✓ Branch 14 → 20 taken 1 time.
|
2 | if (sex == QLatin1String("M")) |
| 414 | 1 | return QStringLiteral("Male"); | |
| 415 |
1/2✓ Branch 22 → 23 taken 1 time.
✗ Branch 22 → 28 not taken.
|
1 | if (sex == QLatin1String("O")) |
| 416 | 1 | return QStringLiteral("Other"); | |
| 417 | ✗ | if (sex == QLatin1String("N")) | |
| 418 | ✗ | return QStringLiteral("None"); | |
| 419 | ✗ | return QStringLiteral("Unknown"); | |
| 420 | } | ||
| 421 | |||
| 422 | // GENDER: the sex component follows the editor; the identity component and | ||
| 423 | // the line's name, group and parameters stay. A new line is GENDER on 4.0 | ||
| 424 | // and X-GENDER on 3.0 cards (D-8); no sex removes the line. | ||
| 425 | 26452 | void applyGender(Writer *w, const ContactCard &before, const ContactCard &after) { | |
| 426 |
2/2✓ Branch 3 → 4 taken 26025 times.
✓ Branch 3 → 5 taken 427 times.
|
26452 | if (before.gender == after.gender) |
| 427 | 26443 | return; | |
| 428 |
1/1✓ Branch 8 → 9 taken 427 times.
|
427 | int index = indexOfName(w->card, QStringLiteral("GENDER")); |
| 429 |
2/2✓ Branch 11 → 12 taken 419 times.
✓ Branch 11 → 19 taken 8 times.
|
427 | if (index < 0) |
| 430 |
1/1✓ Branch 15 → 16 taken 419 times.
|
419 | index = indexOfName(w->card, QStringLiteral("X-GENDER")); |
| 431 |
3/3✓ Branch 19 → 20 taken 427 times.
✓ Branch 20 → 21 taken 427 times.
✓ Branch 21 → 22 taken 427 times.
|
427 | const QString sex = after.gender.trimmed().left(1).toUpper(); |
| 432 |
2/2✓ Branch 25 → 26 taken 3 times.
✓ Branch 25 → 29 taken 424 times.
|
427 | if (sex.isEmpty()) { |
| 433 |
1/2✓ Branch 26 → 27 taken 3 times.
✗ Branch 26 → 28 not taken.
|
3 | if (index >= 0) |
| 434 |
1/1✓ Branch 27 → 28 taken 3 times.
|
3 | w->removeAt(index); |
| 435 | 3 | return; | |
| 436 | } | ||
| 437 |
2/2✓ Branch 29 → 30 taken 415 times.
✓ Branch 29 → 66 taken 9 times.
|
424 | if (index < 0) { |
| 438 |
2/4✓ Branch 41 → 42 taken 1245 times.
✓ Branch 41 → 43 taken 415 times.
✗ Branch 122 → 123 not taken.
✗ Branch 122 → 124 not taken.
|
1660 | const QSet<QString> near{QStringLiteral("BDAY"), QStringLiteral("BIRTHPLACE"), QStringLiteral("X-MAILJD-BIRTHPLACE")}; |
| 439 |
8/12✓ Branch 47 → 48 taken 22 times.
✓ Branch 47 → 51 taken 393 times.
✓ Branch 55 → 56 taken 415 times.
✓ Branch 56 → 57 taken 415 times.
✓ Branch 59 → 60 taken 393 times.
✓ Branch 59 → 61 taken 22 times.
✓ Branch 61 → 62 taken 22 times.
✓ Branch 61 → 63 taken 393 times.
✗ Branch 144 → 145 not taken.
✗ Branch 144 → 146 not taken.
✗ Branch 148 → 149 not taken.
✗ Branch 148 → 150 not taken.
|
830 | w->insert(insertionPoint(*w, near), make(w->v4 ? QStringLiteral("GENDER") : QStringLiteral("X-GENDER"), sex)); |
| 440 | 415 | return; | |
| 441 | 415 | } | |
| 442 |
1/1✓ Branch 66 → 67 taken 9 times.
|
9 | ICal::Property &property = w->card.properties[index]; |
| 443 |
2/2✓ Branch 70 → 71 taken 9 times.
✓ Branch 71 → 72 taken 9 times.
|
9 | const QString stored = property.value.section(QLatin1Char(';'), 0, 0).trimmed(); |
| 444 |
1/1✓ Branch 74 → 75 taken 9 times.
|
9 | QString wire = genderWire(sex, stored.size() > 1); |
| 445 |
3/3✓ Branch 77 → 78 taken 9 times.
✓ Branch 78 → 79 taken 2 times.
✓ Branch 78 → 90 taken 7 times.
|
9 | if (property.value.contains(QLatin1Char(';'))) |
| 446 |
3/3✓ Branch 82 → 83 taken 2 times.
✓ Branch 85 → 86 taken 2 times.
✓ Branch 86 → 87 taken 2 times.
|
2 | wire += QLatin1Char(';') + property.value.section(QLatin1Char(';'), 1); |
| 447 |
1/2✓ Branch 91 → 92 taken 9 times.
✗ Branch 91 → 94 not taken.
|
9 | if (wire != property.value) { |
| 448 |
1/1✓ Branch 92 → 93 taken 9 times.
|
9 | property.setValue(wire); |
| 449 | 9 | w->changed = true; | |
| 450 | } | ||
| 451 | 2087 | } | |
| 452 | |||
| 453 | // A pinned position is the GEO parameter of its ADR line (D-10). An address | ||
| 454 | // read from the card finds its line by its source index (S106-164: the | ||
| 455 | // editor drops empty addresses while their lines stay, so an ordinal put | ||
| 456 | // the pin on the wrong line); a new address takes the next new ADR line. | ||
| 457 | 26452 | void applyAddressGeo(Writer *w, const ContactCard &after) { | |
| 458 | 26452 | QList<int> newLines; | |
| 459 |
2/2✓ Branch 18 → 3 taken 188756 times.
✓ Branch 18 → 19 taken 26452 times.
|
215208 | for (int i = 0; i < w->card.properties.size(); ++i) |
| 460 |
8/11✓ Branch 5 → 6 taken 188756 times.
✓ Branch 7 → 8 taken 2559 times.
✓ Branch 7 → 11 taken 186197 times.
✓ Branch 9 → 10 taken 2064 times.
✓ Branch 9 → 11 taken 495 times.
✓ Branch 12 → 13 taken 188756 times.
✗ Branch 12 → 14 not taken.
✓ Branch 14 → 15 taken 2064 times.
✓ Branch 14 → 16 taken 186692 times.
✗ Branch 85 → 86 not taken.
✗ Branch 85 → 87 not taken.
|
188756 | if (baseName(w->card.properties.at(i)) == QLatin1String("ADR") && w->origin.value(i, -1) < 0) |
| 461 |
1/1✓ Branch 15 → 16 taken 2064 times.
|
2064 | newLines.append(i); |
| 462 | 26452 | int nextNew = 0; | |
| 463 |
2/2✓ Branch 82 → 21 taken 2558 times.
✓ Branch 82 → 83 taken 26452 times.
|
29010 | for (const ContactAddress &address : after.addresses) { |
| 464 |
2/3✓ Branch 22 → 23 taken 2558 times.
✗ Branch 23 → 24 not taken.
✓ Branch 23 → 25 taken 2558 times.
|
2558 | if (address.isEmpty()) |
| 465 | 2552 | continue; // the editor writes no line for it | |
| 466 | 2558 | int line = -1; | |
| 467 |
2/2✓ Branch 25 → 26 taken 494 times.
✓ Branch 25 → 27 taken 2064 times.
|
2558 | if (address.sourceIndex >= 0) |
| 468 | 494 | line = w->currentIndex(address.sourceIndex); | |
| 469 |
1/2✓ Branch 28 → 29 taken 2064 times.
✗ Branch 28 → 31 not taken.
|
2064 | else if (nextNew < newLines.size()) |
| 470 | 2064 | line = newLines.at(nextNew++); | |
| 471 |
5/11✓ Branch 31 → 32 taken 2558 times.
✗ Branch 31 → 37 not taken.
✓ Branch 34 → 35 taken 2558 times.
✗ Branch 36 → 37 not taken.
✓ Branch 36 → 38 taken 2558 times.
✓ Branch 39 → 40 taken 2558 times.
✗ Branch 39 → 41 not taken.
✗ Branch 41 → 42 not taken.
✓ Branch 41 → 43 taken 2558 times.
✗ Branch 90 → 91 not taken.
✗ Branch 90 → 92 not taken.
|
2558 | if (line < 0 || baseName(w->card.properties.at(line)) != QLatin1String("ADR")) |
| 472 | ✗ | continue; | |
| 473 |
1/1✓ Branch 43 → 44 taken 2558 times.
|
2558 | ICal::Property &property = w->card.properties[line]; |
| 474 |
2/2✓ Branch 47 → 48 taken 2558 times.
✓ Branch 48 → 49 taken 2558 times.
|
2558 | const GeoPoint current = GeoPoint::fromText(property.parameter(QStringLiteral("GEO"))); |
| 475 | 2558 | const GeoPoint wanted = address.geo; | |
| 476 |
7/8✓ Branch 53 → 54 taken 6 times.
✓ Branch 53 → 56 taken 2552 times.
✓ Branch 54 → 55 taken 5 times.
✓ Branch 54 → 57 taken 1 time.
✗ Branch 55 → 56 not taken.
✓ Branch 55 → 57 taken 5 times.
✓ Branch 58 → 59 taken 2552 times.
✓ Branch 58 → 60 taken 6 times.
|
2558 | if (current == wanted || (!current.valid && !wanted.valid)) |
| 477 | 2552 | continue; | |
| 478 |
2/2✓ Branch 60 → 61 taken 5 times.
✓ Branch 60 → 70 taken 1 time.
|
6 | if (wanted.valid) |
| 479 |
2/2✓ Branch 61 → 62 taken 5 times.
✓ Branch 65 → 66 taken 5 times.
|
10 | property.setParameter(QStringLiteral("GEO"), wanted.toUri()); |
| 480 | else | ||
| 481 |
1/1✓ Branch 73 → 74 taken 1 time.
|
1 | property.removeParameter(QStringLiteral("GEO")); |
| 482 | 6 | property.originalLine.clear(); | |
| 483 | 6 | w->changed = true; | |
| 484 | } | ||
| 485 | 26452 | } | |
| 486 | |||
| 487 | // ─── mail links (D-15) ─── | ||
| 488 | |||
| 489 | 138 | int writeMailLink(Writer *w, int position, const ContactMailLink &link) { | |
| 490 |
3/6✓ Branch 3 → 4 taken 138 times.
✗ Branch 3 → 6 not taken.
✗ Branch 5 → 6 not taken.
✓ Branch 5 → 7 taken 138 times.
✗ Branch 8 → 9 not taken.
✓ Branch 8 → 10 taken 138 times.
|
138 | if (link.messageId.isEmpty() || link.messageId.size() > 998) |
| 491 | ✗ | return position; | |
| 492 | 138 | QList<ICal::Parameter> parameters; | |
| 493 |
1/2✓ Branch 11 → 12 taken 138 times.
✗ Branch 11 → 20 not taken.
|
138 | if (!link.subject.isEmpty()) |
| 494 | 138 | parameters.append({QStringLiteral("X-SUBJECT"), link.subject.left(200)}); | |
| 495 |
1/2✓ Branch 21 → 22 taken 138 times.
✗ Branch 21 → 30 not taken.
|
138 | if (!link.date.isEmpty()) |
| 496 | 138 | parameters.append({QStringLiteral("X-DATE"), link.date}); | |
| 497 | // RFC 2392: the Message-ID without angle brackets, URL-encoded except the | ||
| 498 | // characters its examples keep ("mid:960830.1639@XIson.com"). | ||
| 499 |
3/3✓ Branch 31 → 32 taken 138 times.
✓ Branch 32 → 33 taken 138 times.
✓ Branch 33 → 34 taken 138 times.
|
138 | const QString mid = QString::fromLatin1(QUrl::toPercentEncoding(link.messageId, "!$&'()*+=@-._~")); |
| 500 |
2/2✓ Branch 40 → 41 taken 138 times.
✓ Branch 45 → 46 taken 138 times.
|
414 | w->insert(position, make(QStringLiteral("X-MAILJD-MAIL"), QStringLiteral("mid:") + mid, parameters)); |
| 501 | 138 | return position + 1; | |
| 502 | 414 | } | |
| 503 | |||
| 504 | 26452 | void applyMailLinks(Writer *w, const ContactCard &before, const ContactCard &after) { | |
| 505 |
2/2✓ Branch 3 → 4 taken 26313 times.
✓ Branch 3 → 5 taken 139 times.
|
26452 | if (before.mailLinks == after.mailLinks) |
| 506 | 26313 | return; | |
| 507 |
2/4✓ Branch 12 → 13 taken 139 times.
✓ Branch 12 → 14 taken 139 times.
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 22 not taken.
|
278 | patchList( |
| 508 |
1/1✓ Branch 9 → 10 taken 139 times.
|
278 | w, before.mailLinks, after.mailLinks, {QStringLiteral("X-MAILJD-MAIL")}, |
| 509 | 1282 | [](const ContactMailLink &a, const ContactMailLink &b) { return a == b; }, | |
| 510 | 138 | [w](int position, const ContactMailLink &link) { return writeMailLink(w, position, link); }); | |
| 511 | 278 | } | |
| 512 | |||
| 513 | } // namespace | ||
| 514 | |||
| 515 | 26452 | void applyPeople(Writer *w, const ContactCard &before, const ContactCard &after) { | |
| 516 | 26452 | applyRelations(w, before, after); | |
| 517 | 26452 | applyMet(w, before, after); | |
| 518 | 26452 | applySocial(w, before, after); | |
| 519 | 26452 | applyPersonal(w, before, after); | |
| 520 | 26452 | applyGender(w, before, after); | |
| 521 | 26452 | applyAddressGeo(w, after); | |
| 522 | 26452 | applyMailLinks(w, before, after); | |
| 523 | 26452 | } | |
| 524 | |||
| 525 | } // namespace VCardCodec::detail | ||
| 526 |