~ubuntu-branches/ubuntu/vivid/liferea/vivid-proposed

« back to all changes in this revision

Viewing changes to src/parsers/ns_dc.c

  • Committer: Package Import Robot
  • Author(s): Moray Allan, Bojo42, Rodrigo Gallardo, Moray Allan
  • Date: 2012-03-27 21:44:42 UTC
  • mfrom: (1.5.1)
  • mto: (3.3.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 122.
  • Revision ID: package-import@ubuntu.com-20120327214442-g0xfh714cdmsbnts
Tags: 1.8.3-0.1
[ Bojo42 ]
* Non-maintainer upload.
* New upstream release (Closes: #502307, #623619, #631778, #651913) 
* debian/patches:
  - drop libnotify0.7 as in upstream
  - debian-example-feeds: update, move planets from "News" to "Open Source"
  - www-browser: update due to new file location
  - libtool-dont-rearange-as-needed: rebase
* debian/control:
  - update Standards-Version
  - remove obsolete Build-Depends:
    - quilt not needed for "3.0 (quilt)" source format
    - libnm-glib-dev & libdbus-glib-1-dev: upstream switched to GDBus
    - liblua5.1-0-dev: LUA scripting support got dropped
  - new Build-Depends on libunique-dev, libjson-glib-dev & dh_autoreconf
  - update version dependencies
* debian/rules: run dh_autoreconf & update translations
* debian/liferea.install: nothing to ship from /usr/lib/liferea

[ Rodrigo Gallardo ]
* Lintian love:
  - debian/control: switch from Conflicts to Breaks
  - debian/rules: redo build targets

[ Moray Allan ]
* debian/copyright: update to include additional copyright owners.
* debian/patches/www-browser: also set default external browser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 * @file ns_dc.c Dublin Core support for RSS and Atom
3
3
 *
4
 
 * Copyright (C) 2003-2007 Lars Lindner <lars.lindner@gmail.com>
 
4
 * Copyright (C) 2003-2010 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
18
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
19
 */
20
20
 
21
 
 
22
 
#ifdef HAVE_CONFIG_H
23
 
#  include <config.h>
24
 
#endif
25
 
 
26
 
#define _XOPEN_SOURCE   600     /* glibc2 needs this (man strptime) */
27
 
 
28
21
#include "ns_dc.h"
 
22
 
 
23
#include "date.h"
29
24
#include "common.h"
30
25
#include "metadata.h"
31
26
 
120
115
                                  };
121
116
 
122
117
static const gchar * mapToItemMetadata[] = {
123
 
                                        "itemTitle",            /* title */ 
 
118
                                        NULL,                   /* title */ 
124
119
                                        "creator",              /* creator */
125
120
                                        "category",             /* subject */
126
121
                                        "description",          /* description */
146
141
        const gchar     *mapping;
147
142
        gboolean        isNotEmpty;
148
143
        
149
 
        /* special handling for the ISO 8601 date item tags */
150
144
        if (!isFeedTag) {
 
145
                /* special handling for the ISO 8601 date item tags */
151
146
                if (!xmlStrcmp (BAD_CAST "date", cur->name)) {
152
 
                        if (NULL != (date = common_utf8_fix ((gchar *)xmlNodeListGetString (cur->doc, cur->xmlChildrenNode, 1)))) {
153
 
                                i = parseISO8601Date (date);
 
147
                        if (NULL != (date = (gchar *)xmlNodeListGetString (cur->doc, cur->xmlChildrenNode, 1))) {
 
148
                                i = date_parse_ISO8601 (date);
154
149
                                ctxt->item->time = i;
155
150
                                g_free (date);
156
151
                        }
157
152
                        return;
158
153
                }
 
154
 
 
155
                /* special handling for item titles */
 
156
                if(!xmlStrcmp (BAD_CAST "title", cur->name)) {
 
157
                        value = (gchar *)xmlNodeListGetString(cur->doc, cur->xmlChildrenNode, 1);
 
158
                        if(value) {
 
159
                                item_set_title(ctxt->item, value);
 
160
                                g_free(value);
 
161
                        }
 
162
                        return;
 
163
                }
159
164
        }
160
165
 
161
166
        /* compare with each possible tag name */
162
167
        for (i = 0; taglist[i] != NULL; i++) {
163
168
                if (!xmlStrcmp ((const xmlChar *)taglist[i], cur->name)) {
164
 
                        value = common_utf8_fix ((gchar *)xmlNodeListGetString(cur->doc, cur->xmlChildrenNode, 1));
 
169
                        value = (gchar *)xmlNodeListGetString(cur->doc, cur->xmlChildrenNode, 1);
165
170
                        if (value) {
166
171
                                /* check if value consist of whitespaces only */                                
167
172
                                for (j = 0, tmp = value, isNotEmpty = FALSE; j < g_utf8_strlen (value, -1); j++) {