~ubuntu-branches/ubuntu/saucy/liferea/saucy

« back to all changes in this revision

Viewing changes to src/parsers/pie_entry.c

  • Committer: Package Import Robot
  • Author(s): bojo42
  • Date: 2012-03-29 14:17:21 UTC
  • mfrom: (1.3.9) (3.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20120329141721-tbfopcrc5797wxt7
Tags: 1.8.3-0.1ubuntu1
* New upstream release (LP: #290666, #371754, #741543, #716688)
* Merge from Debian unstable (LP: #935147), remaining changes:
* debian/patches:
  - drop gtk-status-icon.patch & notification-append as in upstream
  - drop fix_systray_behavior as mostly upstreamed and rest seems unused
  - 01_ubuntu_feedlists: update & rename, move planets to "Open Source"  
  - add_X-Ubuntu-Gettext-Domain: rebase
  - libunity.patch: rebase, apply before indicator patch (liferea_shell.c)
  - libindicate_increase_version.patch: exclude from libindicate.patch
  - deactivate libindicate.patch, seems partly upstreamed and needs rework
* debian/control: libindicate-dev, libindicate-gtk-dev & libunity-dev
* debian/liferea.indicate & liferea.install: ship indicator desktop file
* debian/rules: enable libindicate

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 * @file pie_entry.c  Atom0.3 entry parsing 
3
3
 *
4
 
 * Copyright (C) 2003-2008 Lars Lindner <lars.lindner@gmail.com>
 
4
 * Copyright (C) 2003-2009 Lars Lindner <lars.lindner@gmail.com>
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or modify
7
7
 * it under the terms of the GNU General Public License as published by
24
24
#include <libxml/parser.h>
25
25
 
26
26
#include "common.h"
 
27
#include "date.h"
27
28
#include "feed_parser.h"
28
29
#include "pie_entry.h"
29
30
#include "pie_feed.h"
82
83
                                g_free(tmp2);
83
84
                        } else {
84
85
                                /* 0.2 link : element content is the link, or non-alternate link in 0.3 */
85
 
                                if(NULL != (tmp = common_utf8_fix((gchar *)xmlNodeListGetString(ctxt->doc, cur->xmlChildrenNode, 1)))) {
 
86
                                if(NULL != (tmp = (gchar *)xmlNodeListGetString(ctxt->doc, cur->xmlChildrenNode, 1))) {
86
87
                                        item_set_source(ctxt->item, tmp);
87
88
                                        g_free(tmp);
88
89
                                }
98
99
                        ctxt->item->metadata = metadata_list_append(ctxt->item->metadata, "contributor", tmp);
99
100
                        g_free(tmp);
100
101
                } else if(!xmlStrcmp(cur->name, BAD_CAST"id")) {
101
 
                        if(NULL != (tmp = common_utf8_fix((gchar *)xmlNodeListGetString(ctxt->doc, cur->xmlChildrenNode, 1)))) {
 
102
                        if(NULL != (tmp = (gchar *)xmlNodeListGetString(ctxt->doc, cur->xmlChildrenNode, 1))) {
102
103
                                item_set_id(ctxt->item, tmp);
103
104
                                g_free(tmp);
104
105
                        }
105
106
                } else if(!xmlStrcmp(cur->name, BAD_CAST"issued")) {
106
107
                        /* FIXME: is <modified> or <issued> or <created> the time tag we want to display? */
107
 
                        if(NULL != (tmp = common_utf8_fix((gchar *)xmlNodeListGetString(ctxt->doc, cur->xmlChildrenNode, 1)))) {
108
 
                                ctxt->item->time = parseISO8601Date(tmp);
 
108
                        if(NULL != (tmp = (gchar *)xmlNodeListGetString(ctxt->doc, cur->xmlChildrenNode, 1))) {
 
109
                                ctxt->item->time = date_parse_ISO8601 (tmp);
109
110
                                g_free(tmp);
110
111
                        }
111
112
                } else if(!xmlStrcmp(cur->name, BAD_CAST"content")) {
112
113
                        /* <content> support */
113
 
                        if(NULL != (tmp = common_utf8_fix(pie_parse_content_construct(cur)))) {
 
114
                        if(NULL != (tmp = pie_parse_content_construct(cur))) {
114
115
                                item_set_description(ctxt->item, tmp);
115
116
                                g_free(tmp);
116
117
                        }
118
119
                        /* <summary> can be used for short text descriptions, if there is no
119
120
                           <content> description we show the <summary> content */
120
121
                        if(!item_get_description(ctxt->item)) {
121
 
                                if(NULL != (tmp = common_utf8_fix(pie_parse_content_construct(cur)))) {
 
122
                                if(NULL != (tmp = pie_parse_content_construct(cur))) {
122
123
                                        item_set_description(ctxt->item, tmp);
123
124
                                        g_free(tmp);
124
125
                                }
125
126
                        }
126
127
                } else if(!xmlStrcmp(cur->name, BAD_CAST"copyright")) {
127
 
                        if(NULL != (tmp = common_utf8_fix((gchar *)xmlNodeListGetString(ctxt->doc, cur->xmlChildrenNode, 1)))) {
 
128
                        if(NULL != (tmp = (gchar *)xmlNodeListGetString(ctxt->doc, cur->xmlChildrenNode, 1))) {
128
129
                                ctxt->item->metadata = metadata_list_append(ctxt->item->metadata, "copyright", tmp);
129
130
                                g_free(tmp);
130
131
                        }