From 3303c7855cb22a6bb4f36aa1a17707187320f5d2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 18 Sep 2026 14:58:58 +0200 Subject: feat: add ContactStore, the vCard address-book parse Reads a vdirsyncer contacts directory of vCard 3.0 files into a QList for the completion work that follows. Pure over values, no widget and no QCompleter, so the parse is testable without a window. unfold() joins folded lines before any field is looked at; parseCard() splits property from value on the first colon outside a quoted parameter, unescapes FN, and yields one contact per EMAIL line; loadDirectory() walks recursively, skips unreadable or addressless cards, de-duplicates on the address case-insensitively, and sorts by name then address. N, PHOTO, ADR and TEL are deliberately not used. 23 new tests. No user-facing strings, so no tr() change. --- tests/fixtures/contact_twoemails.vcf | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/fixtures/contact_twoemails.vcf (limited to 'tests/fixtures/contact_twoemails.vcf') diff --git a/tests/fixtures/contact_twoemails.vcf b/tests/fixtures/contact_twoemails.vcf new file mode 100644 index 0000000..41325ed --- /dev/null +++ b/tests/fixtures/contact_twoemails.vcf @@ -0,0 +1,6 @@ +BEGIN:VCARD +VERSION:3.0 +FN:Dana Two +EMAIL:dana@example.org +EMAIL;TYPE=HOME:dana.home@example.org +END:VCARD -- cgit v1.2.3