[evolution-data-server/wip/tintou/libedataserverui-introspection: 1/2] Fixed some warnings in the GObject Annotations.



commit 45f3a88d3081c30968a8694eb2058adc8ea6edfe
Author: Corentin Noël <corentin elementary io>
Date:   Tue Oct 18 22:46:15 2016 +0200

    Fixed some warnings in the GObject Annotations.

 .../libebook-contacts/e-address-western.c          |   56 ++++++++++++--------
 .../libebook-contacts/e-address-western.h          |    2 +
 src/addressbook/libebook-contacts/e-contact.c      |   36 +++++++++++--
 src/addressbook/libebook-contacts/e-name-western.c |   26 +++++++++
 src/addressbook/libebook-contacts/e-name-western.h |    2 +
 src/addressbook/libebook-contacts/e-phone-number.h |   14 +++---
 src/addressbook/libebook/e-book-client-view.c      |    2 +-
 src/addressbook/libebook/e-book-client.c           |    2 +-
 src/addressbook/libebook/e-book-client.h           |    6 +-
 src/addressbook/libebook/e-destination.c           |   22 ++++----
 src/libedataserver/e-client.c                      |    2 +-
 src/libedataserver/e-network-monitor.h             |    2 +-
 src/libedataserver/eds-version.c                   |    2 +-
 13 files changed, 120 insertions(+), 54 deletions(-)
---
diff --git a/src/addressbook/libebook-contacts/e-address-western.c 
b/src/addressbook/libebook-contacts/e-address-western.c
index 65e2106..4890a1b 100644
--- a/src/addressbook/libebook-contacts/e-address-western.c
+++ b/src/addressbook/libebook-contacts/e-address-western.c
@@ -33,6 +33,8 @@ static const gchar *extended_keywords[] = {
        "apt", "apartment", "suite", NULL
 };
 
+G_DEFINE_BOXED_TYPE (EAddressWestern, e_address_western, e_address_western_copy, e_address_western_free);
+
 static gboolean
 e_address_western_is_line_blank (gchar *line)
 {
@@ -324,14 +326,7 @@ e_address_western_parse (const gchar *in_address)
        if (in_address == NULL)
                return NULL;
 
-       eaw = (EAddressWestern *) g_malloc (sizeof (EAddressWestern));
-       eaw->po_box = NULL;
-       eaw->extended = NULL;
-       eaw->street = NULL;
-       eaw->locality = NULL;
-       eaw->region = NULL;
-       eaw->postal_code = NULL;
-       eaw->country = NULL;
+       eaw = g_new0 (EAddressWestern, 1);
 
        address = g_strndup (in_address, 2047);
 
@@ -438,21 +433,38 @@ e_address_western_free (EAddressWestern *eaw)
        if (eaw == NULL)
                return;
 
-       if (eaw->po_box != NULL)
-               g_free (eaw->po_box);
-       if (eaw->extended != NULL)
-               g_free (eaw->extended);
-       if (eaw->street != NULL)
-               g_free (eaw->street);
-       if (eaw->locality != NULL)
-               g_free (eaw->locality);
-       if (eaw->region != NULL)
-               g_free (eaw->region);
-       if (eaw->postal_code != NULL)
-               g_free (eaw->postal_code);
-       if (eaw->country != NULL)
-               g_free (eaw->country);
+       g_free (eaw->po_box);
+       g_free (eaw->extended);
+       g_free (eaw->street);
+       g_free (eaw->locality);
+       g_free (eaw->region);
+       g_free (eaw->postal_code);
+       g_free (eaw->country);
 
        g_free (eaw);
 }
 
+/**
+ * e_address_western_copy:
+ * @eaw: an #EAddressWestern
+ *
+ * Creates a copy of @eaw.
+ *
+ * Returns: (transfer full): A new #EAddressWestern struct identical to @eaw.
+ **/
+EAddressWestern *
+e_address_western_copy (EAddressWestern *eaw)
+{
+       EAddressWestern *waddress;
+       waddress = g_new0 (EAddressWestern, 1);
+       waddress->po_box = g_strdup (eaw->po_box);
+       waddress->extended = g_strdup (eaw->extended);
+       waddress->street = g_strdup (eaw->street);
+       waddress->locality = g_strdup (eaw->locality);
+       waddress->region = g_strdup (eaw->region);
+       waddress->postal_code = g_strdup (eaw->postal_code);
+       waddress->country = g_strdup (eaw->country);
+
+       return waddress;
+}
+
diff --git a/src/addressbook/libebook-contacts/e-address-western.h 
b/src/addressbook/libebook-contacts/e-address-western.h
index 34c5f75..9ab64fd 100644
--- a/src/addressbook/libebook-contacts/e-address-western.h
+++ b/src/addressbook/libebook-contacts/e-address-western.h
@@ -48,8 +48,10 @@ typedef struct {
        gchar *country;
 } EAddressWestern;
 
+GType         e_address_western_get_type (void) G_GNUC_CONST;
 EAddressWestern *e_address_western_parse (const gchar *in_address);
 void e_address_western_free (EAddressWestern *eaw);
+EAddressWestern *e_address_western_copy (EAddressWestern *eaw);
 
 G_END_DECLS
 
diff --git a/src/addressbook/libebook-contacts/e-contact.c b/src/addressbook/libebook-contacts/e-contact.c
index dea9dce..a1cdd2d 100644
--- a/src/addressbook/libebook-contacts/e-contact.c
+++ b/src/addressbook/libebook-contacts/e-contact.c
@@ -1971,7 +1971,7 @@ e_contact_name_from_string (const gchar *name_str)
  *
  * Creates a copy of @n.
  *
- * Returns: A new #EContactName identical to @n.
+ * Returns: (transfer full): A new #EContactName identical to @n.
  **/
 EContactName *
 e_contact_name_copy (EContactName *n)
@@ -2119,7 +2119,7 @@ e_contact_date_equal (EContactDate *dt1,
  *
  * Creates a copy of @dt.
  *
- * Returns: A new #EContactDate struct identical to @dt.
+ * Returns: (transfer full): A new #EContactDate struct identical to @dt.
  **/
 static EContactDate *
 e_contact_date_copy (EContactDate *dt)
@@ -2208,7 +2208,7 @@ e_contact_photo_free (EContactPhoto *photo)
  *
  * Creates a copy of @photo.
  *
- * Returns: A new #EContactPhoto struct identical to @photo.
+ * Returns: (transfer full): A new #EContactPhoto struct identical to @photo.
  *
  * Since: 3.8
  **/
@@ -2533,6 +2533,14 @@ e_contact_geo_free (EContactGeo *geo)
        g_free (geo);
 }
 
+/**
+ * e_contact_geo_copy:
+ * @geo: an #EContactGeo
+ *
+ * Creates a copy of @geo.
+ *
+ * Returns: (transfer full): A new #EContactGeo struct identical to @geo.
+ **/
 static EContactGeo *
 e_contact_geo_copy (EContactGeo *geo)
 {
@@ -2584,6 +2592,14 @@ e_contact_address_free (EContactAddress *address)
        g_free (address);
 }
 
+/**
+ * e_contact_address_copy:
+ * @address: an #EContactAddress
+ *
+ * Creates a copy of @address.
+ *
+ * Returns: (transfer full): A new #EContactAddress struct identical to @address.
+ **/
 static EContactAddress *
 e_contact_address_copy (EContactAddress *address)
 {
@@ -2636,6 +2652,14 @@ e_contact_cert_free (EContactCert *cert)
        g_free (cert);
 }
 
+/**
+ * e_contact_cert_copy:
+ * @cert: an #EContactCert
+ *
+ * Creates a copy of @cert.
+ *
+ * Returns: (transfer full): A new #EContactCert struct identical to @cert.
+ **/
 static EContactCert *
 e_contact_cert_copy (EContactCert *cert)
 {
@@ -2651,13 +2675,13 @@ E_CONTACT_DEFINE_BOXED_TYPE (e_contact_cert, "EContactCert")
 
 /**
  * e_contact_attr_list_copy:
- * @list: A #GList of strings
+ * @list: (element-type utf8): A #GList of strings
  *
  * Copies a list of allocated strings, specifically
  * for the #EContactAttrList boxed type used for multi valued
  * contact fields.
  *
- * Returns: (transfer full): A copy of @list
+ * Returns: (transfer full) (element-type utf8): A copy of @list
  *
  * Since: 3.8
  */
@@ -2669,7 +2693,7 @@ e_contact_attr_list_copy (GList *list)
 
 /**
  * e_contact_attr_list_free:
- * @list: A #GList of strings
+ * @list: (element-type utf8): A #GList of strings
  *
  * Frees a list of allocated strings, specifically
  * for the #EContactAttrList boxed type used for multi valued
diff --git a/src/addressbook/libebook-contacts/e-name-western.c 
b/src/addressbook/libebook-contacts/e-name-western.c
index aa44ba9..26693d4 100644
--- a/src/addressbook/libebook-contacts/e-name-western.c
+++ b/src/addressbook/libebook-contacts/e-name-western.c
@@ -25,6 +25,7 @@
 
 #include <ctype.h>
 #include <string.h>
+#include <gio/gio.h>
 
 #include "e-name-western.h"
 #include "e-name-western-tables.h"
@@ -38,6 +39,8 @@ typedef struct {
        gint suffix_idx;
 } ENameWesternIdxs;
 
+G_DEFINE_BOXED_TYPE (ENameWestern, e_name_western, e_name_western_copy, e_name_western_free);
+
 static gint
 e_name_western_str_count_words (const gchar *str)
 {
@@ -1040,3 +1043,26 @@ e_name_western_free (ENameWestern *w)
 
        g_free (w);
 }
+
+/**
+ * e_name_western_copy:
+ * @w: an #ENameWestern
+ *
+ * Creates a copy of @w.
+ *
+ * Returns: (transfer full): A new #ENameWestern struct identical to @w.
+ **/
+ENameWestern *
+e_name_western_copy (ENameWestern *w)
+{
+       ENameWestern *wname;
+       wname = g_new0 (ENameWestern, 1);
+       wname->prefix = g_strdup (w->prefix);
+       wname->first = g_strdup (w->first);
+       wname->middle = g_strdup (w->middle);
+       wname->nick = g_strdup (w->nick);
+       wname->last = g_strdup (w->last);
+       wname->suffix = g_strdup (w->suffix);
+       wname->full = g_strdup (w->full);
+       return wname;
+}
diff --git a/src/addressbook/libebook-contacts/e-name-western.h 
b/src/addressbook/libebook-contacts/e-name-western.h
index b3ea42d..36f34fd 100644
--- a/src/addressbook/libebook-contacts/e-name-western.h
+++ b/src/addressbook/libebook-contacts/e-name-western.h
@@ -37,8 +37,10 @@ typedef struct {
        gchar *full;
 } ENameWestern;
 
+GType         e_name_western_get_type (void) G_GNUC_CONST;
 ENameWestern *e_name_western_parse (const gchar   *full_name);
 void          e_name_western_free  (ENameWestern *w);
+ENameWestern *e_name_western_copy  (ENameWestern *w);
 
 G_END_DECLS
 
diff --git a/src/addressbook/libebook-contacts/e-phone-number.h 
b/src/addressbook/libebook-contacts/e-phone-number.h
index 614f46f..7e3cbc1 100644
--- a/src/addressbook/libebook-contacts/e-phone-number.h
+++ b/src/addressbook/libebook-contacts/e-phone-number.h
@@ -17,6 +17,13 @@
  * Authors: Mathias Hasselmann <mathias openismus com>
  */
 
+#if !defined (__LIBEBOOK_CONTACTS_H_INSIDE__) && !defined (LIBEBOOK_CONTACTS_COMPILATION)
+#error "Only <libebook-contacts/libebook-contacts.h> should be included directly."
+#endif
+
+#ifndef E_PHONE_NUMBER_H
+#define E_PHONE_NUMBER_H
+
 /**
  * SECTION: e-phone-number
  * @include: libedataserver/libedataserver.h
@@ -26,13 +33,6 @@
  * phone numbers. Under the hood it uses Google's libphonenumber.
  **/
 
-#if !defined (__LIBEBOOK_CONTACTS_H_INSIDE__) && !defined (LIBEBOOK_CONTACTS_COMPILATION)
-#error "Only <libebook-contacts/libebook-contacts.h> should be included directly."
-#endif
-
-#ifndef E_PHONE_NUMBER_H
-#define E_PHONE_NUMBER_H
-
 #include <glib-object.h>
 
 G_BEGIN_DECLS
diff --git a/src/addressbook/libebook/e-book-client-view.c b/src/addressbook/libebook/e-book-client-view.c
index 01b9049..a18dab3 100644
--- a/src/addressbook/libebook/e-book-client-view.c
+++ b/src/addressbook/libebook/e-book-client-view.c
@@ -1067,7 +1067,7 @@ e_book_client_view_init (EBookClientView *client_view)
  * The returned #EBookClient is referenced for thread-safety.  Unreference
  * the #EBookClient with g_object_unref() when finished with it.
  *
- * Returns: an #EBookClient
+ * Returns: (transfer full): an #EBookClient
  *
  * Since: 3.10
  **/
diff --git a/src/addressbook/libebook/e-book-client.c b/src/addressbook/libebook/e-book-client.c
index 3fc2091..986a8c7 100644
--- a/src/addressbook/libebook/e-book-client.c
+++ b/src/addressbook/libebook/e-book-client.c
@@ -3992,7 +3992,7 @@ e_book_client_get_view_finish (EBookClient *client,
  * e_book_client_get_view_sync:
  * @client: an #EBookClient
  * @sexp: an S-expression representing the query
- * @out_view: (out) an #EBookClientView
+ * @out_view: (out): an #EBookClientView
  * @cancellable: a #GCancellable; can be %NULL
  * @error: (out): a #GError to set an error, if any
  *
diff --git a/src/addressbook/libebook/e-book-client.h b/src/addressbook/libebook/e-book-client.h
index 3a557f9..9eaa4ad 100644
--- a/src/addressbook/libebook/e-book-client.h
+++ b/src/addressbook/libebook/e-book-client.h
@@ -51,7 +51,7 @@
        ((obj), E_TYPE_BOOK_CLIENT, EBookClientClass))
 
 /**
- * BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS:
+ * BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS: (value "required-fields")
  *
  * FIXME: Document me.
  *
@@ -60,7 +60,7 @@
 #define BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS          "required-fields"
 
 /**
- * BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS:
+ * BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS: (value "supported-fields")
  *
  * FIXME: Document me.
  *
@@ -319,7 +319,7 @@ const gchar *       e_book_client_get_locale        (EBookClient *client);
 
 #ifndef EDS_DISABLE_DEPRECATED
 /**
- * BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS:
+ * BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS: (value "supported-auth-methods")
  *
  * Since: 3.2
  *
diff --git a/src/addressbook/libebook/e-destination.c b/src/addressbook/libebook/e-destination.c
index 599e4bc..bbe4aef 100644
--- a/src/addressbook/libebook/e-destination.c
+++ b/src/addressbook/libebook/e-destination.c
@@ -823,7 +823,7 @@ e_destination_set_auto_recipient (EDestination *dest,
  *
  * Gets the contact @dest is pointing to, if any.
  *
- * Returns: (transfer none): An #EContact, or %NULL if none was set.
+ * Returns: (transfer none) (nullable): An #EContact, or %NULL if none was set.
  **/
 EContact *
 e_destination_get_contact (const EDestination *dest)
@@ -839,7 +839,7 @@ e_destination_get_contact (const EDestination *dest)
  *
  * Gets the unique contact ID @dest is pointing to, if any.
  *
- * Returns: A unique contact ID, or %NULL if none was set.
+ * Returns: (nullable): A unique contact ID, or %NULL if none was set.
  */
 const gchar *
 e_destination_get_contact_uid (const EDestination *dest)
@@ -856,7 +856,7 @@ e_destination_get_contact_uid (const EDestination *dest)
  * Gets the unique source ID @dest is pointing to, if any. The source
  * ID specifies which address book @dest's contact came from.
  *
- * Returns: A unique source ID, or %NULL if none was set.
+ * Returns: (nullable): A unique source ID, or %NULL if none was set.
  */
 const gchar *
 e_destination_get_source_uid (const EDestination *dest)
@@ -893,7 +893,7 @@ e_destination_get_email_num (const EDestination *dest)
  * Gets the full name of @dest's addressee, or if the addressee is
  * a contact list, the name the list was filed under.
  *
- * Returns: The full name of the addressee, or %NULL if none was set.
+ * Returns: (nullable): The full name of the addressee, or %NULL if none was set.
  **/
 const gchar *
 e_destination_get_name (const EDestination *dest)
@@ -1058,7 +1058,7 @@ destination_get_address (const EDestination *dest,
  * encoded list of email addresses, from @dest.  The returned string is
  * suitable for use in an email header, but not for displaying to users.
  *
- * Returns: an encoded destination string suitable for use in an
+ * Returns: (nullable): an encoded destination string suitable for use in an
  *          email header, or %NULL if the destination was empty
  **/
 const gchar *
@@ -1302,7 +1302,7 @@ e_destination_set_html_mail_pref (EDestination *dest,
 
 /**
  * e_destination_get_textrepv:
- * @destv: %NULL-terminated array of pointers to #EDestination
+ * @destv: (array zero-terminated=1): %NULL-terminated array of pointers to #EDestination
  *
  * Generates a joint text representation of all the #EDestination
  * elements in @destv.
@@ -1655,7 +1655,7 @@ e_destination_export (const EDestination *dest)
  *
  * Creates an #EDestination from an XML document.
  *
- * Returns: (transfer full): An #EDestination, or %NULL if the document was not
+ * Returns: (transfer full) (nullable): An #EDestination, or %NULL if the document was not
  * well-formed.
  **/
 EDestination *
@@ -1682,7 +1682,7 @@ e_destination_import (const gchar *str)
 
 /**
  * e_destination_exportv:
- * @destv: a %NULL-terminated array of pointers to #EDestination
+ * @destv: (array zero-terminated=1): a %NULL-terminated array of pointers to #EDestination
  *
  * Exports multiple #EDestination elements to a single XML document.
  *
@@ -1728,8 +1728,8 @@ e_destination_exportv (EDestination **destv)
  * Creates an array of pointers to #EDestination elements
  * from an XML document.
  *
- * Returns: (transfer full):A %NULL-terminated array of pointers to
- * #EDestination elements.
+ * Returns: (transfer full) (array zero-terminated=1): A %NULL-terminated
+ * array of pointers to #EDestination elements.
  **/
 EDestination **
 e_destination_importv (const gchar *str)
@@ -1782,7 +1782,7 @@ e_destination_importv (const gchar *str)
 
 /**
  * e_destination_freev:
- * @destv: a %NULL-terminated array of pointers to #EDestination
+ * @destv: (array zero-terminated=1): a %NULL-terminated array of pointers to #EDestination
  *
  * Unrefs the elements of @destv and frees @destv itself.
  **/
diff --git a/src/libedataserver/e-client.c b/src/libedataserver/e-client.c
index dc27150..2978aad 100644
--- a/src/libedataserver/e-client.c
+++ b/src/libedataserver/e-client.c
@@ -898,7 +898,7 @@ e_client_class_init (EClientClass *class)
                        G_PARAM_STATIC_STRINGS));
 
        /**
-        * EClient::opened:
+        * EClient:opened-signal: (skip)
         *
         * Deprecated: 3.8: This signal is no longer emitted.
         **/
diff --git a/src/libedataserver/e-network-monitor.h b/src/libedataserver/e-network-monitor.h
index 1d64100..5a658f5 100644
--- a/src/libedataserver/e-network-monitor.h
+++ b/src/libedataserver/e-network-monitor.h
@@ -49,7 +49,7 @@ typedef struct _ENetworkMonitorClass ENetworkMonitorClass;
 typedef struct _ENetworkMonitorPrivate ENetworkMonitorPrivate;
 
 /**
- * @E_NETWORK_MONITOR_ALWAYS_ONLINE_NAME:
+ * E_NETWORK_MONITOR_ALWAYS_ONLINE_NAME: (value "always-online")
  *
  * A special name, which can be used as a GIO name in the call
  * to e_network_monitor_set_gio_name(), which is used to report
diff --git a/src/libedataserver/eds-version.c b/src/libedataserver/eds-version.c
index 447c115..c595626 100644
--- a/src/libedataserver/eds-version.c
+++ b/src/libedataserver/eds-version.c
@@ -23,7 +23,7 @@ const guint eds_minor_version = EDS_MINOR_VERSION;
 const guint eds_micro_version = EDS_MICRO_VERSION;
 
 /**
- * eds_check_version: (rename-to e_check_version)
+ * eds_check_version:
  * @required_major: the required major version
  * @required_minor: the required minor version
  * @required_micro: the required micro version


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]