[evolution-data-server] ebook: make EContactCert usable in Vala
- From: Patrick Ohly <pohly src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] ebook: make EContactCert usable in Vala
- Date: Fri, 15 Feb 2013 10:36:24 +0000 (UTC)
commit b3332015a95cbf2e2b8ff32468d053667f4420ca
Author: Patrick Ohly <patrick ohly intel com>
Date: Thu Feb 14 18:01:19 2013 +0100
ebook: make EContactCert usable in Vala
"new E.ContactCert()" in Vala fails because the struct has no
constructor. Introducing e_contact_cert_new() fixes that problem.
This extends the API instead of changing it. It is still valid
to allocated EContactCert instances via some other means.
addressbook/libebook-contacts/e-contact.c | 17 +++++++++++++++++
addressbook/libebook-contacts/e-contact.h | 1 +
2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/libebook-contacts/e-contact.c b/addressbook/libebook-contacts/e-contact.c
index 3749b67..ed6a011 100644
--- a/addressbook/libebook-contacts/e-contact.c
+++ b/addressbook/libebook-contacts/e-contact.c
@@ -2563,6 +2563,23 @@ e_contact_address_copy (EContactAddress *address)
E_CONTACT_DEFINE_BOXED_TYPE (e_contact_address, "EContactAddress")
/**
+ * e_contact_cert_new:
+ *
+ * Creates an #EContactCert struct with all values set to 0.
+ *
+ * Returns: (transfer full): A new #EContactCert struct.
+ *
+ * Since: 3.8
+ **/
+EContactCert *
+e_contact_cert_new (void)
+{
+ EContactCert *cert;
+ cert = g_new0 (EContactCert, 1);
+ return cert;
+}
+
+/**
* e_contact_cert_free:
* @cert: an #EContactCert
*
diff --git a/addressbook/libebook-contacts/e-contact.h b/addressbook/libebook-contacts/e-contact.h
index e698aa6..1593424 100644
--- a/addressbook/libebook-contacts/e-contact.h
+++ b/addressbook/libebook-contacts/e-contact.h
@@ -385,6 +385,7 @@ gboolean e_contact_inline_local_photos (EContact *contact,
GType e_contact_geo_get_type (void);
void e_contact_geo_free (EContactGeo *geo);
+EContactCert * e_contact_cert_new (void);
GType e_contact_cert_get_type (void);
void e_contact_cert_free (EContactCert *cert);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]