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

« back to all changes in this revision

Viewing changes to src/fl_sources/node_source.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 node_source.c  generic node source provider implementation
3
3
 * 
4
 
 * Copyright (C) 2005-2009 Lars Lindner <lars.lindner@gmail.com>
 
4
 * Copyright (C) 2005-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
32
32
#include "item_state.h"
33
33
#include "node.h"
34
34
#include "node_type.h"
 
35
#include "ui/icons.h"
35
36
#include "ui/liferea_dialog.h"
36
37
#include "ui/ui_common.h"
37
38
#include "ui/ui_node.h"
39
40
#include "fl_sources/dummy_source.h"
40
41
#include "fl_sources/google_source.h"
41
42
#include "fl_sources/opml_source.h"
42
 
#include "notification/notification.h"
 
43
#include "fl_sources/ttrss_source.h"
43
44
 
44
45
static GSList   *nodeSourceTypes = NULL;
45
46
 
 
47
nodePtr
 
48
node_source_root_from_node (nodePtr node)
 
49
 
50
        while (node->parent->source == node->source) 
 
51
                node = node->parent;
 
52
                
 
53
        return node;
 
54
}
 
55
 
46
56
static nodeSourceTypePtr
47
57
node_source_type_find (const gchar *typeStr, guint capabilities)
48
58
{
63
73
static gboolean
64
74
node_source_type_register (nodeSourceTypePtr type)
65
75
{
66
 
        /* check feed list provider plugin version */
67
 
        if (NODE_SOURCE_TYPE_API_VERSION != type->api_version) {
68
 
                debug3 (DEBUG_PLUGINS, "feed list source API version mismatch: \"%s\" has version %d should be %d", type->name, type->api_version, NODE_SOURCE_TYPE_API_VERSION);
69
 
                return FALSE;
70
 
        } 
71
 
 
72
 
        /* check if all mandatory functions are provided */
73
 
        if (!(type->source_type_init &&
74
 
              type->source_type_deinit)) {
75
 
                debug1 (DEBUG_PLUGINS, "mandatory functions missing: \"%s\"", type->name);
76
 
                return FALSE;
77
 
        }
78
 
 
79
76
        /* allow the plugin to initialize */
80
77
        type->source_type_init ();
81
78
 
97
94
        node_source_type_register (dummy_source_get_type ());
98
95
        node_source_type_register (opml_source_get_type ());
99
96
        node_source_type_register (google_source_get_type ());
 
97
        node_source_type_register (ttrss_source_get_type ());
100
98
 
101
99
        type = node_source_type_find (NULL, NODE_SOURCE_CAPABILITY_IS_ROOT);
102
100
        if (!type) 
242
240
        }               
243
241
 
244
242
        /* set up the dialog */
245
 
        dialog = liferea_dialog_new ("node_source.glade", "node_source_type_dialog");
 
243
        dialog = liferea_dialog_new ("node_source.ui", "node_source_type_dialog");
246
244
 
247
245
        treestore = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
248
246
        
370
368
        if (NULL != NODE_SOURCE_TYPE (node)->source_delete)
371
369
                NODE_SOURCE_TYPE (node)->source_delete (node);
372
370
                
373
 
        notification_node_removed (node);
374
371
        ui_node_remove_node (node);
375
372
}
376
373
 
399
396
                /* derive the node source node type from the folder node type */
400
397
                nodeType = (nodeTypePtr) g_new0 (struct nodeType, 1);
401
398
                nodeType->id                    = "source";
402
 
                nodeType->icon                  = icons[ICON_DEFAULT];
 
399
                nodeType->icon                  = icon_get (ICON_DEFAULT);
403
400
                nodeType->capabilities          = NODE_CAPABILITY_SHOW_UNREAD_COUNT |
404
401
                                                  NODE_CAPABILITY_SHOW_ITEM_FAVICONS |
405
402
                                                  NODE_CAPABILITY_UPDATE_CHILDS |
406
403
                                                  NODE_CAPABILITY_UPDATE |
 
404
                                                  NODE_CAPABILITY_UPDATE_FAVICON |
407
405
                                                  NODE_CAPABILITY_ADD_CHILDS |
408
406
                                                  NODE_CAPABILITY_REMOVE_CHILDS;
409
407
                nodeType->import                = node_source_import;