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

« back to all changes in this revision

Viewing changes to src/parsers/cdf_channel.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 cdf_channel.c CDF channel parsing
3
3
 *
4
 
 * Copyright (C) 2003-2009 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
23
23
   things being case insensitive. Some people seem to make the tags
24
24
   capitalized, while others are like "Channel". */
25
25
 
 
26
#include "cdf_channel.h"
 
27
 
26
28
#include <sys/time.h>
27
29
#include <string.h>
28
30
#include <libxml/xmlmemory.h>
29
31
#include <libxml/parser.h>
 
32
 
30
33
#include "common.h"
31
34
#include "feedlist.h"
32
 
#include "cdf_channel.h"
33
35
#include "cdf_item.h"
34
36
#include "metadata.h"
35
37
#include "xml.h"
49
51
                }
50
52
 
51
53
                if((!xmlStrcasecmp(cur->name, BAD_CAST"logo"))) {
52
 
                        tmp = common_utf8_fix((gchar *)xmlGetProp(cur, BAD_CAST"HREF"));
 
54
                        tmp = (gchar *)xmlGetProp(cur, BAD_CAST"HREF");
53
55
                        if(tmp) {
54
 
                                tmp = common_utf8_fix((gchar *)xmlGetProp(cur, BAD_CAST"href"));
 
56
                                tmp = (gchar *)xmlGetProp(cur, BAD_CAST"href");
55
57
                                metadata_list_set (&ctxt->subscription->metadata, "imageUrl", tmp);
56
58
                                g_free(tmp);
57
59
                        }
72
74
                        }
73
75
 
74
76
                } else if(!xmlStrcasecmp(cur->name, BAD_CAST "title")) {
75
 
                        tmp = common_utf8_fix((gchar *)xmlNodeListGetString(cur->doc, cur->xmlChildrenNode, TRUE));
 
77
                        tmp = (gchar *)xmlNodeListGetString(cur->doc, cur->xmlChildrenNode, TRUE);
76
78
                        if(tmp) {
77
79
                                tmp = unhtmlize(tmp);
78
80
                                
82
84
                        }
83
85
                        
84
86
                } else if (!xmlStrcasecmp(cur->name, BAD_CAST "abstract")) {
85
 
                        tmp = common_utf8_fix ((gchar *)xmlNodeListGetString (cur->doc, cur->xmlChildrenNode, TRUE));
 
87
                        tmp = (gchar *)xmlNodeListGetString (cur->doc, cur->xmlChildrenNode, TRUE);
86
88
                        if (tmp) {
87
89
                                metadata_list_set (&ctxt->subscription->metadata, "description", tmp);
88
90
                                xmlFree (tmp);
92
94
                        tmp = g_ascii_strdown((gchar *)cur->name, -1);
93
95
                        tmp2 = g_hash_table_lookup(channelHash, tmp);
94
96
                        if(tmp2) {
95
 
                                tmp3 = common_utf8_fix((gchar *)xmlNodeListGetString(cur->doc, cur->xmlChildrenNode, TRUE));
 
97
                                tmp3 = (gchar *)xmlNodeListGetString(cur->doc, cur->xmlChildrenNode, TRUE);
96
98
                                if(tmp3) {
97
99
                                        ctxt->subscription->metadata = metadata_list_append(ctxt->subscription->metadata, tmp2, tmp3);
98
100
                                        g_free(tmp3);
181
183
        
182
184
        /* prepare feed handler structure */
183
185
        fhp->typeStr = "cdf";
184
 
        fhp->icon = ICON_AVAILABLE;
185
186
        fhp->feedParser = cdf_parse;
186
187
        fhp->checkFormat = cdf_format_check;
187
 
        fhp->merge = TRUE;
188
188
        return fhp;
189
189
}