| 1 | From 45cb9a2d7e8cffd17bab05e29ee38f0463743a9c Mon Sep 17 00:00:00 2001
|
| 2 | From: Milan Crha <[email protected]>
|
| 3 | Date: Fri, 17 Oct 2025 11:10:09 +0200
|
| 4 | Subject: [PATCH] vcard-export: Adapt to evolution-data-server 3.59.1 EVCard
|
| 5 | API changes
|
| 6 |
|
| 7 | The e_vcard_to_string() newly does not have any argument, the vCard
|
| 8 | is saved in a version it is stored in the structure. To export in
|
| 9 | a specific version, one can use e_vcard_convert_to_string().
|
| 10 |
|
| 11 | Upstream-Status: Merged in version 50.alpha
|
| 12 | ---
|
| 13 | meson.build | 3 +++
|
| 14 | src/io/contacts-io-vcard-export-operation.vala | 10 ++++++++++
|
| 15 | 2 files changed, 13 insertions(+)
|
| 16 |
|
| 17 | diff --git a/meson.build b/meson.build
|
| 18 | index e2a70a98..b90cb36d 100644
|
| 19 | |
| 20 | |
| 21 | @@ -52,6 +52,9 @@ libadwaita_dep = dependency('libadwaita-1', version: '>= 1.8.alpha')
|
| 22 | # E-D-S
|
| 23 | libebook = dependency('libebook-1.2', version: '>=' + min_eds_version)
|
| 24 | libedataserver = dependency('libedataserver-1.2', version: '>=' + min_eds_version)
|
| 25 | +if libebook.version().version_compare('>=3.59.1')
|
| 26 | + add_project_arguments('-D', 'HAVE_EDS_3_59_1', language: 'vala')
|
| 27 | +endif
|
| 28 | # Camera
|
| 29 | libportal_dep = dependency('libportal-gtk4', version: '>= 0.7')
|
| 30 | gstreamer_dep = dependency('gstreamer-1.0')
|
| 31 | diff --git a/src/io/contacts-io-vcard-export-operation.vala b/src/io/contacts-io-vcard-export-operation.vala
|
| 32 | index 74ed6572..a692a67d 100644
|
| 33 | |
| 34 | |
| 35 | @@ -16,7 +16,9 @@ public class Contacts.Io.VCardExportOperation : ExportOperation {
|
| 36 |
|
| 37 | // We _could_ parameterize this with our own enum, but there's no need for
|
| 38 | // that at the moment.
|
| 39 | +#if !HAVE_EDS_3_59_1
|
| 40 | private E.VCardFormat vcard_format = E.VCardFormat.@30;
|
| 41 | +#endif
|
| 42 |
|
| 43 | // This should always be on false, except for debugging/troubleshooting
|
| 44 | // purposes. It forces E-D-S personas to use our manual serialization instead
|
| 45 | @@ -53,7 +55,11 @@ public class Contacts.Io.VCardExportOperation : ExportOperation {
|
| 46 | // that's an E.VCard already
|
| 47 | if (persona is Edsf.Persona && !avoid_eds) {
|
| 48 | unowned var contact = ((Edsf.Persona) persona).contact;
|
| 49 | +#if HAVE_EDS_3_59_1
|
| 50 | + return contact.to_string ();
|
| 51 | +#else
|
| 52 | return contact.to_string (this.vcard_format);
|
| 53 | +#endif
|
| 54 | }
|
| 55 |
|
| 56 | var vcard = new E.VCard ();
|
| 57 | @@ -104,7 +110,11 @@ public class Contacts.Io.VCardExportOperation : ExportOperation {
|
| 58 | vcard_set_webservice_details (vcard, (WebServiceDetails) persona);
|
| 59 | */
|
| 60 |
|
| 61 | +#if HAVE_EDS_3_59_1
|
| 62 | + return vcard.to_string ();
|
| 63 | +#else
|
| 64 | return vcard.to_string (this.vcard_format);
|
| 65 | +#endif
|
| 66 | }
|
| 67 |
|
| 68 | private void vcard_set_avatar_details (E.VCard vcard,
|
| 69 | --
|
| 70 | GitLab
|
| 71 |
|