[libgrss] added "feed-fail" signal for GrssFeedsPool minor corrections for GIR scanner parser



commit bceb3afc6bc3ba15db925d21bd959394c124abe3
Author: Roberto Guido <bob4job gmail com>
Date:   Tue Dec 24 19:28:34 2013 +0100

    added "feed-fail" signal for GrssFeedsPool
    minor corrections for GIR scanner parser

 src/Makefile.am        |    2 +-
 src/feed-channel.c     |   16 +++++++++-------
 src/feed-item.c        |   14 +++++++-------
 src/feed-marshal.list  |    1 +
 src/feed-parser.c      |    6 +++---
 src/feeds-group.c      |    8 ++++----
 src/feeds-pool.c       |   29 ++++++++++++++++++++---------
 src/feeds-publisher.c  |   14 +++++++-------
 src/feeds-store.c      |    4 ++--
 src/feeds-subscriber.c |   14 +++++++-------
 10 files changed, 61 insertions(+), 47 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index f7bb01d..26ff8ef 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -102,7 +102,7 @@ EXTRA_DIST = \
 
 -include $(INTROSPECTION_MAKEFILE)
 INTROSPECTION_GIRS =
-INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) $(GIFLAGS)
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all $(GIFLAGS)
 INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
 
 if HAVE_INTROSPECTION
diff --git a/src/feed-channel.c b/src/feed-channel.c
index e349204..927a24d 100644
--- a/src/feed-channel.c
+++ b/src/feed-channel.c
@@ -640,7 +640,8 @@ grss_feed_channel_add_contributor (GrssFeedChannel *channel, gchar *contributor)
  *
  * Retrieves reference to the contributors of the @channel.
  *
- * Return value: (element-type utf8) (transfer none) list of contributors to the channel, or %NULL.
+ * Return value: (element-type utf8) (transfer none): list of contributors to
+ * the channel, or %NULL.
  */
 const GList*
 grss_feed_channel_get_contributors (GrssFeedChannel *channel)
@@ -671,7 +672,8 @@ grss_feed_channel_add_cookie (GrssFeedChannel *channel, SoupCookie *cookie)
  * The list and the individual cookies should all be freed after use.
  * You can use soup_cookies_free.
  *
- * Return value: (element-type SoupCookie) (transfer full) list of cookies to the channel, or %NULL.
+ * Return value: (element-type SoupCookie) (transfer full): list of cookies to
+ * the channel, or %NULL.
  */
 GSList*
 grss_feed_channel_get_cookies (GrssFeedChannel *channel)
@@ -727,7 +729,7 @@ grss_feed_channel_set_generator (GrssFeedChannel *channel, gchar *generator)
  * grss_feed_channel_set_gzip_compression:
  * Set the Gzip compression for the channel to on or off
  * @value either enable (TRUE) or disable compression (FALSE)
- * 
+ *
  */
 void
 grss_feed_channel_set_gzip_compression(GrssFeedChannel *channel, gboolean value)
@@ -751,14 +753,14 @@ grss_feed_channel_get_generator (GrssFeedChannel *channel)
 
 /**
  * grss_feed_channel_get_gzip_compression:
- * 
+ *
  * GZip Compression of the channel is either on or off
  */
 gboolean
 grss_feed_channel_get_gzip_compression (GrssFeedChannel *channel)
 {
        return channel->priv->gzip;
-}      
+}
 
 /**
  * grss_feed_channel_set_publish_time:
@@ -1030,7 +1032,7 @@ grss_feed_channel_fetch_async (GrssFeedChannel *channel, GAsyncReadyCallback cal
  * Utility to fetch and populate a #GrssFeedChannel, and retrieve all its
  * items.
  *
- * Return value: (element-type GrssFeedItem) (transfer full) a GList
+ * Return value: (element-type GrssFeedItem) (transfer full): a GList
  * of #GrssFeedItem, to be completely unreferenced and freed when no
  * longer in use, or %NULL if an error occurs.
  */
@@ -1145,7 +1147,7 @@ grss_feed_channel_fetch_all_async (GrssFeedChannel *channel, GAsyncReadyCallback
  * Finalizes an asyncronous operation started with
  * grss_feed_channel_fetch_all_async().
  *
- * Return value: (element-type GrssFeedItem) (transfer none) list of
+ * Return value: (element-type GrssFeedItem) (transfer none): list of
  * items fetched from the #GrssFeedChannel, or %NULL if @error is
  * set. The list (and contained items) is freed at the end of the
  * callback
diff --git a/src/feed-item.c b/src/feed-item.c
index 212ef9a..c9eed0b 100644
--- a/src/feed-item.c
+++ b/src/feed-item.c
@@ -147,7 +147,7 @@ grss_feed_item_new (GrssFeedChannel *parent)
  *
  * Retrieves the feed from which the item belongs.
  *
- * Return value: (transfer none) the parent feed, as set in grss_feed_item_new().
+ * Return value: (transfer none): the parent feed, as set in grss_feed_item_new().
  */
 GrssFeedChannel*
 grss_feed_item_get_parent (GrssFeedItem *item)
@@ -283,7 +283,7 @@ grss_feed_item_add_category (GrssFeedItem *item, gchar *category)
  *
  * Retrieves list of categories assigned to the @item.
  *
- * Return value: (element-type utf8) (transfer none) list of strings,
+ * Return value: (element-type utf8) (transfer none): list of strings,
  * one for assigned category. Do not free or modify this list.
  */
 const GList*
@@ -465,8 +465,8 @@ grss_feed_item_add_contributor (GrssFeedItem *item, gchar *contributor)
  *
  * Retrieves contributors for @item.
  *
- * Return value: (element-type utf8) (transfer none) list of
- * contributors to the item.
+ * Return value: (element-type utf8) (transfer none): list of contributors to
+ * the item.
  */
 const GList*
 grss_feed_item_get_contributors (GrssFeedItem *item)
@@ -604,9 +604,9 @@ grss_feed_item_add_enclosure (GrssFeedItem *item, GrssFeedEnclosure *enclosure)
  *
  * Retrieves the list of enclosures added with grss_feed_item_add_enclosure().
  *
- * Return value: (element-type GrssFeedEnclosure) (transfer none) a
- * list of #GrssFeedEnclosure. This is a direct reference to the
- * internal list, do not free or modify it.
+ * Return value: (element-type GrssFeedEnclosure) (transfer none): a list of
+ * #GrssFeedEnclosure. This is a direct reference to the internal list, do not
+ * free or modify it.
  */
 const GList*
 grss_feed_item_get_enclosures (GrssFeedItem *item)
diff --git a/src/feed-marshal.list b/src/feed-marshal.list
index 73366cb..97c9a30 100644
--- a/src/feed-marshal.list
+++ b/src/feed-marshal.list
@@ -1,3 +1,4 @@
+VOID:OBJECT
 VOID:OBJECT,POINTER
 VOID:OBJECT,STRING
 VOID:OBJECT,OBJECT
diff --git a/src/feed-parser.c b/src/feed-parser.c
index dbc3245..de38b8d 100644
--- a/src/feed-parser.c
+++ b/src/feed-parser.c
@@ -159,9 +159,9 @@ retrieve_feed_handler (GrssFeedParser *parser, xmlDocPtr doc, xmlNodePtr cur)
  * Parses the given XML @doc, belonging to the given @feed, to obtain a list
  * of #GrssFeedItem.
  *
- * Return value: (element-type GrssFeedItem) (transfer full) a list of
- * #GrssFeedItem, to be freed when no longer in use, or NULL if an
- * error occours and @error is set.
+ * Return value: (element-type GrssFeedItem) (transfer full): a list of
+ * #GrssFeedItem, to be freed when no longer in use, or NULL if anerror occours
+ * and @error is set.
  */
 GList*
 grss_feed_parser_parse (GrssFeedParser *parser, GrssFeedChannel *feed, xmlDocPtr doc, GError **error)
diff --git a/src/feeds-group.c b/src/feeds-group.c
index 9931562..2cc72ff 100644
--- a/src/feeds-group.c
+++ b/src/feeds-group.c
@@ -139,7 +139,7 @@ retrieve_group_handler (GrssFeedsGroup *group, xmlDocPtr doc, xmlNodePtr cur)
  *
  * Returns the list of supported file formats.
  *
- * Return value: (element-type utf8) (transfer full) a list of
+ * Return value: (element-type utf8) (transfer full): a list of
  * constant strings with names of supported formats. The list must be
  * freed when no longer used
  */
@@ -170,7 +170,7 @@ grss_feeds_group_get_formats (GrssFeedsGroup *group)
  *
  * Parses the given file to obtain list of listed feeds.
  *
- * Return value: (element-type GrssFeedChannel) (transfer full) a list
+ * Return value: (element-type GrssFeedChannel) (transfer full): a list
  * of #GrssFeedChannels, or NULL if an error occours and @error is
  * set.
  */
@@ -229,7 +229,7 @@ grss_feeds_group_parse_file (GrssFeedsGroup *group, const gchar *path, GError **
 /**
  * grss_feeds_group_export_file:
  * @group: a #GrssFeedsGroup.
- * @channels: (element-type GrssFeedChannel) list of #GrssFeedChannels.
+ * @channels: (element-type GrssFeedChannel): list of #GrssFeedChannels.
  * @format: string rappresenting the desired export format, as returnes by
  *          grss_feeds_group_get_formats().
  * @uri: URI of the file to write.
@@ -237,7 +237,7 @@ grss_feeds_group_parse_file (GrssFeedsGroup *group, const gchar *path, GError **
  *
  * Creates a new file with the list of @channels rappresented in the required
  * @format. It a file already exists at the @uri location, it is overwritten.
- * 
+ *
  * Return value: %TRUE if the file is created correctly, or %FALSE if an error
  * occours and @error is set.
  */
diff --git a/src/feeds-pool.c b/src/feeds-pool.c
index 2cd8574..82b8b16 100644
--- a/src/feeds-pool.c
+++ b/src/feeds-pool.c
@@ -52,6 +52,7 @@ typedef struct {
 enum {
        FEED_FETCHING,
        FEED_READY,
+       FEED_FAIL,
        LAST_SIGNAL
 };
 
@@ -141,6 +142,18 @@ grss_feeds_pool_class_init (GrssFeedsPoolClass *klass)
        signals [FEED_READY] = g_signal_new ("feed-ready", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0,
                                             NULL, NULL, feed_marshal_VOID__OBJECT_POINTER,
                                             G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_POINTER);
+
+       /**
+        * GrssFeedsPool::feed-fail:
+        * @pool: the #GrssFeedsPool emitting the signal.
+        * @feed: the #GrssFeedChannel which failed to fetch or parse.
+        *
+        * Emitted when an error raises in fetching or parsing a #GrssFeedChannel
+        * assigned to the @pool.
+        */
+       signals [FEED_FAIL] = g_signal_new ("feed-fail", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0,
+                                           NULL, NULL, feed_marshal_VOID__OBJECT,
+                                           G_TYPE_NONE, 1, G_TYPE_OBJECT);
 }
 
 static void
@@ -191,7 +204,7 @@ create_listened (GrssFeedsPool *pool, GList *feeds)
 /**
  * grss_feeds_pool_listen:
  * @pool: a #GrssFeedsPool.
- * @feeds: (element-type GrssFeedChannel) a list of #GrssFeedChannel.
+ * @feeds: (element-type GrssFeedChannel): a list of #GrssFeedChannel.
  *
  * To set the list of feeds to be managed by the pool. The previous list, if
  * any, is invalidated. After invokation to the function, grss_feeds_pool_switch()
@@ -221,9 +234,9 @@ grss_feeds_pool_listen (GrssFeedsPool *pool, GList *feeds)
  * time and resources consuming task: if you only need to know how many feeds
  * are currently handled, check grss_feeds_pool_get_listened_num().
  *
- * Return value: (element-type GrssFeedChannel) (transfer container) a
- * list of #GrssFeedChannel, to be freed with g_list_free() when no
- * longer in use. Do not modify elements found in this list.
+ * Return value: (element-type GrssFeedChannel) (transfer container): a
+ * list of #GrssFeedChannel, to be freed with g_list_free() when no longer in
+ * use. Do not modify elements found in this list.
  */
 GList*
 grss_feeds_pool_get_listened (GrssFeedsPool *pool)
@@ -270,12 +283,10 @@ feed_downloaded (GObject *source, GAsyncResult *res, gpointer user_data)
 
        items = grss_feed_channel_fetch_all_finish (GRSS_FEED_CHANNEL (source), res, NULL);
 
-       /*
-               TODO    Emit specific signal also when operation fails
-       */
-
        if (items != NULL)
                g_signal_emit (feed->pool, signals [FEED_READY], 0, feed->channel, items, NULL);
+       else
+               g_signal_emit (feed->pool, signals [FEED_FAIL], 0, feed->channel, NULL);
 
        feed->next_fetch = time (NULL) + (grss_feed_channel_get_update_interval (feed->channel) * 60);
 }
@@ -367,7 +378,7 @@ grss_feeds_pool_switch (GrssFeedsPool *pool, gboolean run)
  *
  * To access the internal #SoupSession used by the @pool to fetch items.
  *
- * Return value: (transfer none) instance of #SoupSession. Do not free it.
+ * Return value: (transfer none): instance of #SoupSession. Do not free it.
  */
 SoupSession*
 grss_feeds_pool_get_session (GrssFeedsPool *pool)
diff --git a/src/feeds-publisher.c b/src/feeds-publisher.c
index 191c91a..352d79a 100644
--- a/src/feeds-publisher.c
+++ b/src/feeds-publisher.c
@@ -227,8 +227,8 @@ grss_feeds_publisher_new ()
  * grss_feeds_publisher_format_content:
  * @pub: a #GrssFeedsPublisher.
  * @channel: the #GrssFeedChannel to dump in the file.
- * @items: (element-type GrssFeedItem) list of #GrssFeedItems to be
- *         added in the feed.
+ * @items: (element-type GrssFeedItem): list of #GrssFeedItems to be added in
+ *         the feed.
  * @error: if an error occourred, %NULL is returned and this is filled with the
  *         message.
  * 
@@ -493,8 +493,8 @@ feed_required_by_web_cb (SoupServer *server, SoupMessage *msg, const char *path,
  * grss_feeds_publisher_publish_web:
  * @pub: a #GrssFeedsPublisher.
  * @channel: the #GrssFeedChannel to dump in the file.
- * @items: (element-type GrssFeedItem) list of #GrssFeedItems to be
- *         added in the feed.
+ * @items: (element-type GrssFeedItem): list of #GrssFeedItems to be added in
+ *         the feed.
  * @id: name used in the external URL of the feed.
  * @error: if an error occourred, %FALSE is returned and this is filled with the
  *         message.
@@ -530,8 +530,8 @@ grss_feeds_publisher_publish_web (GrssFeedsPublisher *pub, GrssFeedChannel *chan
  * grss_feeds_publisher_publish_file:
  * @pub: a #GrssFeedsPublisher.
  * @channel: the #GrssFeedChannel to dump in the file.
- * @items: (element-type GrssFeedItem) list of #GrssFeedItems to be
- * added in the feed.
+ * @items: (element-type GrssFeedItem): list of #GrssFeedItems to be added in
+ *         the feed.
  * @uri: URI of the file to write. The full path must exists.
  * @error: if an error occourred, %FALSE is returned and this is filled with the
  *         message.
@@ -909,7 +909,7 @@ grss_feeds_publisher_hub_set_port (GrssFeedsPublisher *pub, int port)
 /**
  * grss_feeds_publisher_hub_set_topics:
  * @pub: a #GrssFeedsPublisher.
- * @topics: (element-type GrssFeedChannel) a list of #GrssFeedChannels.
+ * @topics: (element-type GrssFeedChannel): a list of #GrssFeedChannels.
  *
  * To define a list of valid "topics" for which the #GrssFeedsPublisher will
  * deliver contents. Sources of those channels, as retrieved by
diff --git a/src/feeds-store.c b/src/feeds-store.c
index cb99586..195dd91 100644
--- a/src/feeds-store.c
+++ b/src/feeds-store.c
@@ -59,7 +59,7 @@ grss_feeds_store_init (GrssFeedsStore *node)
  *
  * To retrieve list of feeds permanently saved into the store.
  *
- * Return value: (element-type GrssFeedChannel) (transfer none) list
+ * Return value: (element-type GrssFeedChannel) (transfer none): list
  * of #GrssFeedChannel found in the @store. Do not modify or free it.
  */
 GList*
@@ -76,7 +76,7 @@ grss_feeds_store_get_channels (GrssFeedsStore *store)
  * To retrieve list of items saved into the store, assigned to the given
  * @channel.
  *
- * Return value: (element-type GrssFeedItem) (transfer none) list of
+ * Return value: (element-type GrssFeedItem) (transfer none): list of
  * #GrssFeedItem found in the @store. Do not modify or free it.
  */
 GList*
diff --git a/src/feeds-subscriber.c b/src/feeds-subscriber.c
index 563be3f..2a0e292 100644
--- a/src/feeds-subscriber.c
+++ b/src/feeds-subscriber.c
@@ -41,7 +41,7 @@
  * engage a subscription for each #GrssFeedChannel passed with
  * grss_feeds_subscriber_listen(), and waits for direct notifications by the
  * remote server.
- * 
+ *
  * Pay attention to the fact this object doesn't provides any NAT traversing
  * method to receive notification while behind a NAT.
  */
@@ -251,7 +251,7 @@ create_listened (GrssFeedsSubscriber *sub, GList *feeds)
 /**
  * grss_feeds_subscriber_listen:
  * @sub: a #GrssFeedsSubscriber.
- * @feeds: (element-type GrssFeedChannel) a list of #GrssFeedChannel.
+ * @feeds: (element-type GrssFeedChannel): a list of #GrssFeedChannel.
  *
  * To set the list of feeds to be managed by @sub. The previous list, if any,
  * is invalidated. After invokation to the function, grss_feeds_subscriber_switch()
@@ -275,7 +275,7 @@ grss_feeds_subscriber_listen (GrssFeedsSubscriber *sub, GList *feeds)
  *
  * Returns the list of feeds currently managed by @sub.
  *
- * Return value: (element-type GrssFeedChannel) (transfer container) a
+ * Return value: (element-type GrssFeedChannel) (transfer container): a
  * list of #GrssFeedChannel, to be freed with g_list_free() when no
  * longer in use. Do not modify elements found in this list.
  */
@@ -622,7 +622,7 @@ grss_feeds_subscriber_switch (GrssFeedsSubscriber *sub, gboolean run)
  * external events. It is often required by #GrssFeedsSubscriberHandlers while
  * subscribing contents to specify the local endpoint for communications.
  *
- * Return value: (transfer none) the #GInetAddress used by @sub, or
+ * Return value: (transfer none): the #GInetAddress used by @sub, or
  * %NULL if the #GrssFeedsSubscriber is switched off.
  */
 GInetAddress*
@@ -638,7 +638,7 @@ grss_feeds_subscriber_get_address (GrssFeedsSubscriber *sub)
  * This function returns the Internet port where @sub is listening for
  * external events. It is often required by #GrssFeedsSubscriberHandlers while
  * subscribing contents to specify the local endpoint for communications.
- * 
+ *
  * Return value: the port of the socket locally opened by @sub.
  */
 int
@@ -653,8 +653,8 @@ grss_feeds_subscriber_get_port (GrssFeedsSubscriber *sub)
  *
  * To obtain the internal #SoupSession of a #GrssFeedsSubscriber, so to re-use
  * it in #GrssFeedsSubscriberHandlers or similar tasks.
- * 
- * Return value: (transfer none) the #SoupSession used by the provided
+ *
+ * Return value: (transfer none): the #SoupSession used by the provided
  * #GrssFeedsSubscriber.
  */
 SoupSession*


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