[evolution-data-server] Bug 784182 - Change how code snippets are marked in developer comments



commit e57f8ccb34400c968ab79d59d6a4e6ba6cbd8110
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Mon Jun 26 14:16:09 2017 +0200

    Bug 784182 - Change how code snippets are marked in developer comments

 src/addressbook/libebook/e-book-client-cursor.c |   45 ++++++++++-------------
 src/camel/camel-object-bag.c                    |    6 +--
 src/camel/camel-store.c                         |    6 +--
 src/libedataserver/e-data-server-util.c         |    6 +--
 src/libedataserver/e-extensible.c               |   12 ++----
 5 files changed, 30 insertions(+), 45 deletions(-)
---
diff --git a/src/addressbook/libebook/e-book-client-cursor.c b/src/addressbook/libebook/e-book-client-cursor.c
index 7a8b240..88582bd 100644
--- a/src/addressbook/libebook/e-book-client-cursor.c
+++ b/src/addressbook/libebook/e-book-client-cursor.c
@@ -56,9 +56,8 @@
  * In the following example we create a typical cursor sorted with
  * %E_CONTACT_FAMILY_NAME as the primary sort key and %E_CONTACT_GIVEN_NAME
  * as a tie breaker.
- * <informalexample>
- *   <programlisting>
- *     <![CDATA[EBookClientCursor *cursor = NULL;
+ * |[
+ *     EBookClientCursor *cursor = NULL;
  *     EContactField sort_fields[] = { E_CONTACT_FAMILY_NAME, E_CONTACT_GIVEN_NAME };
  *     EBookCursorSortType sort_types[] = { E_BOOK_CURSOR_SORT_ASCENDING, E_BOOK_CURSOR_SORT_ASCENDING };
  *     GError *error = NULL;
@@ -72,8 +71,8 @@
  *                                        NULL,        // GCancellable
  *                                        &error)) {
  *             // Now we have a cursor ...
- *     }]]></programlisting>
- * </informalexample>
+ *     }
+ * ]|
  * </para>
  * <para>
  * Sort order is immutable, if you need to browse content in a different
@@ -191,9 +190,8 @@
  * such as determining "Forward" / "Back" button sensitivity
  * in a browser interface, or displaying some indication
  * of the view window's position in the full contact list.
- * <informalexample>
- *   <programlisting>
- *     <![CDATA[gint position, total;
+ * |[
+ *     gint position, total;
  *     gdouble percent;
  *
  *     // Fetch the position & total
@@ -210,8 +208,8 @@
  *     // Let the user know the percentage of contacts in the list
  *     // which are positioned before the view position (the
  *     // percentage of the addressbook which the user has seen so far).
- *     update_percentage_of_list_browsed (user_interface, percent);]]></programlisting>
- * </informalexample>
+ *     update_percentage_of_list_browsed (user_interface, percent);
+ * ]|
  * </para>
  * <para>
  * These total and position values are guaranteed to always be coherent, they are
@@ -260,9 +258,8 @@
  * Iterating through the contact list is done with e_book_client_cursor_step(), this
  * function allows one to move the cursor and fetch the results following the current
  * cursor position.
- * <informalexample>
- *   <programlisting>
- *     <![CDATA[GError *error = NULL;
+ * |[
+ *     GError *error = NULL;
  *     GSList *results = NULL;
  *     gint n_results;
  *
@@ -312,8 +309,8 @@
  *         // the end of the list was reached. The next attempt to
  *         // move the cursor in the same direction will result in
  *         // an E_CLIENT_ERROR_QUERY_REFUSED error.
- *       }]]></programlisting>
- * </informalexample>
+ *       }
+ * ]|
  * In the above example we chose %E_BOOK_CURSOR_ORIGIN_CURRENT as our #EBookCursorOrigin so the above
  * call will traverse 10 contacts following the cursor's current position. One can also choose the
  * %E_BOOK_CURSOR_ORIGIN_BEGIN or %E_BOOK_CURSOR_ORIGIN_END origin to start at the beginning or end
@@ -377,9 +374,8 @@
  * to navigate to a specific letter in the results. To set the cursor's position
  * directly before any results starting with a specific letter, one can use
  * e_book_client_cursor_set_alphabetic_index().
- * <informalexample>
- *   <programlisting>
- *     <![CDATA[GError *error = NULL;
+ * |[
+ *     GError *error = NULL;
  *     gint index = currently_selected_index (user_interface);
  *
  *     // At this point 'index' must be a numeric value corresponding
@@ -405,8 +401,8 @@
  *           }
  *
  *         g_clear_error (&error);
- *       }]]></programlisting>
- * </informalexample>
+ *       }
+ * ]|
  * After setting the alphabetic index successfully, you can go ahead
  * and use e_book_client_cursor_step() to load some contacts at the
  * beginning of the given letter.
@@ -430,9 +426,8 @@
  * One can determine the appropriate index for a given #EContact by calling
  * e_book_client_cursor_get_contact_alphabetic_index() after refreshing
  * the currently displayed contacts in a view.
- * <informalexample>
- *   <programlisting>
- *     <![CDATA[EContact *contact;
+ * |[
+ *     EContact *contact;
  *     const gchar * const *alphabet;
  *     gint index;
  *
@@ -447,8 +442,8 @@
  *                                                   NULL, NULL, NULL);
  *
  *     // Update label in user interface
- *     set_alphabetic_position_feedback_text (user_interface, alphabet[index]);]]></programlisting>
- * </informalexample>
+ *     set_alphabetic_position_feedback_text (user_interface, alphabet[index]);
+ * ]|
  * </para>
  * </refsect2>
  *
diff --git a/src/camel/camel-object-bag.c b/src/camel/camel-object-bag.c
index b489014..4c4b8d5 100644
--- a/src/camel/camel-object-bag.c
+++ b/src/camel/camel-object-bag.c
@@ -528,12 +528,10 @@ camel_object_bag_rekey (CamelObjectBag *bag,
  * Returns a #GPtrArray of all the objects in the bag.  The caller owns
  * both the array and the object references, so to free the array use:
  *
- * <informalexample>
- *   <programlisting>
+ * |[
  *     g_ptr_array_foreach (array, (GFunc) g_object_unref, NULL);
  *     g_ptr_array_free (array, TRUE);
- *   </programlisting>
- * </informalexample>
+ * ]|
  *
  * Returns: (element-type GObject) (transfer full): an array of objects in @bag
  **/
diff --git a/src/camel/camel-store.c b/src/camel/camel-store.c
index 2a29f6e..60b0b51 100644
--- a/src/camel/camel-store.c
+++ b/src/camel/camel-store.c
@@ -723,12 +723,10 @@ camel_store_get_folders_bag (CamelStore *store)
  * Returns a #GPtrArray of all the opened folders for the @store. The caller owns
  * both the array and the folder references, so to free the array use:
  *
- * <informalexample>
- *   <programlisting>
+ * |[
  *     g_ptr_array_foreach (array, (GFunc) g_object_unref, NULL);
  *     g_ptr_array_free (array, TRUE);
- *   </programlisting>
- * </informalexample>
+ * ]|
  *
  * Returns: (element-type CamelFolder) (transfer full): an array with all currently
  *   opened folders for the @store.
diff --git a/src/libedataserver/e-data-server-util.c b/src/libedataserver/e-data-server-util.c
index cbb8cd3..3bf423b 100644
--- a/src/libedataserver/e-data-server-util.c
+++ b/src/libedataserver/e-data-server-util.c
@@ -679,8 +679,7 @@ e_util_utf8_normalize (const gchar *str)
  * Admittedly, the function semantics are a little awkward.  The example
  * below illustrates the easiest way to cope with the @gdbus_str argument:
  *
- * <informalexample>
- *   <programlisting>
+ * |[
  *     const gchar *trusted_utf8;
  *     gchar *allocated = NULL;
  *
@@ -692,8 +691,7 @@ e_util_utf8_normalize (const gchar *str)
  *
  *     g_free (allocated);
  *     allocated = NULL;
- *   </programlisting>
- * </informalexample>
+ * ]|
  *
  * Returns: a valid UTF-8 string
  *
diff --git a/src/libedataserver/e-extensible.c b/src/libedataserver/e-extensible.c
index 8f3d7fa..61e0ff1 100644
--- a/src/libedataserver/e-extensible.c
+++ b/src/libedataserver/e-extensible.c
@@ -27,23 +27,20 @@
  * 1. Add the #EExtensible interface when registering the #GType.
  *    There are no methods to implement.
  *
- * <informalexample>
- * <programlisting>
+ * |[
  * #include <libedataserver/libedataserver.h>
  *
  * G_DEFINE_TYPE_WITH_CODE (
  *         ECustomWidget, e_custom_widget, GTK_TYPE_WIDGET,
  *         G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
- * </programlisting>
- * </informalexample>
+ * ]|
  *
  * 2. Load extensions for the class at some point during #GObject
  *    initialization.  Generally this should be done toward the end of
  *    the initialization code, so extensions get a fully initialized
  *    object to work with.
  *
- * <informalexample>
- * <programlisting>
+ * |[
  * static void
  * e_custom_widget_constructed (ECustomWidget *widget)
  * {
@@ -51,8 +48,7 @@
  *
  *         e_extensible_load_extensions (E_EXTENSIBLE (widget));
  * }
- * </programlisting>
- * </informalexample>
+ * ]|
  **/
 
 #include "evolution-data-server-config.h"


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