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

« back to all changes in this revision

Viewing changes to src/fl_sources/opml_source.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 opml_source.c  OPML Planet/Blogroll feed list source
3
3
 * 
4
 
 * Copyright (C) 2006-2009 Lars Lindner <lars.lindner@gmail.com>
 
4
 * Copyright (C) 2006-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
31
31
#include "folder.h"
32
32
#include "node.h"
33
33
#include "xml.h"
 
34
#include "ui/icons.h"
34
35
#include "ui/liferea_dialog.h"
35
 
#include "ui/ui_common.h"
36
 
#include "ui/ui_feedlist.h"
37
 
#include "ui/ui_node.h"
38
36
 
39
37
/** default OPML update interval = once a day */
40
38
#define OPML_SOURCE_UPDATE_INTERVAL 60*60*24
162
160
        node->available = FALSE;
163
161
 
164
162
        if (result->data) {
165
 
                doc = xml_parse (result->data, result->size, FALSE, NULL);
 
163
                doc = xml_parse (result->data, result->size, NULL);
166
164
                if (doc) {
167
165
                        gchar *filename;
168
166
                        
190
188
                        if (g_str_equal (node_get_title (node), OPML_SOURCE_DEFAULT_TITLE)) {
191
189
                                title = xpath_find (root, "/opml/head/title"); 
192
190
                                if (title) {
193
 
                                        xmlChar *titleStr = common_utf8_fix (xmlNodeListGetString(title->doc, title->xmlChildrenNode, 1));
 
191
                                        xmlChar *titleStr = xmlNodeListGetString(title->doc, title->xmlChildrenNode, 1);
194
192
                                        if (titleStr) {
195
193
                                                node_set_title (node, titleStr);
196
194
                                                xmlFree (titleStr);
223
221
        opml_subscription_process_update_result
224
222
};
225
223
 
226
 
subscriptionTypePtr opml_source_get_subscription_type (void) { return &opmlSubscriptionType; }
227
 
 
228
224
/* OPML source type implementation */
229
225
 
230
226
static void ui_opml_source_get_source_url (void);
242
238
 
243
239
        debug_enter ("opml_source_import");
244
240
 
245
 
        filename = g_strdup_printf ("%s.png", NODE_SOURCE_TYPE (node)->id);
246
 
        node->icon = ui_common_create_pixbuf (filename);
247
 
        g_free (filename);
248
 
        
 
241
        /* We only ship an icon for opml, not for other sources */
 
242
        if (g_str_equal (NODE_SOURCE_TYPE (node)->id, "fl_opml"))
 
243
                node->icon = icon_create_from_file ("fl_opml.png");
 
244
 
249
245
        debug1 (DEBUG_CACHE, "starting import of opml source instance (id=%s)", node->id);
250
246
        filename = opml_source_get_feedlist (node);
251
247
        if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
300
296
        g_free (filename);
301
297
}
302
298
 
303
 
void
 
299
static void
304
300
opml_source_update (nodePtr node)
305
301
{
306
302
        subscription_update (node->subscription, 0);  // FIXME: 0 ?
307
303
}
308
304
 
309
 
void
 
305
static void
310
306
opml_source_auto_update (nodePtr node)
311
307
{
312
308
        GTimeVal        now;
325
321
/* node source type definition */
326
322
 
327
323
static struct nodeSourceType nst = {
328
 
        NODE_SOURCE_TYPE_API_VERSION,
329
324
        "fl_opml",
330
325
        N_("Planet, BlogRoll, OPML"),
331
326
        N_("Integrate blogrolls or Planets in your feed list. Liferea will "
389
384
static void
390
385
on_opml_file_choose_clicked (GtkButton *button, gpointer user_data)
391
386
{
392
 
        ui_choose_file (_("Choose OPML File"), GTK_STOCK_OPEN, FALSE, on_opml_file_selected, NULL, NULL, user_data);
 
387
        ui_choose_file (_("Choose OPML File"), GTK_STOCK_OPEN, FALSE, on_opml_file_selected, NULL, NULL, "*.opml", _("OPML Files"), user_data);
393
388
}
394
389
 
395
390
static void
397
392
{
398
393
        GtkWidget       *dialog, *button;
399
394
 
400
 
        dialog = liferea_dialog_new ("opml_source.glade", "opml_source_dialog");
 
395
        dialog = liferea_dialog_new ("opml_source.ui", "opml_source_dialog");
401
396
        button = liferea_dialog_lookup (dialog, "select_button");
402
397
 
403
398
        g_signal_connect (G_OBJECT (dialog), "response",