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

« back to all changes in this revision

Viewing changes to src/fl_sources/google_source_feed.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:
24
24
#include <libxml/xpathInternals.h>
25
25
 
26
26
#include "common.h"
27
 
#include "conf.h"
28
27
#include "debug.h"
29
28
#include "xml.h"
30
29
 
87
86
        xmlFreeNode (node);
88
87
}
89
88
 
90
 
void 
91
 
google_source_item_set_flag (nodePtr node, itemPtr item, gboolean newStatus)
92
 
{
93
 
        const gchar* sourceUrl = metadata_list_get (item->metadata, "GoogleBroadcastOrigFeed");
94
 
        if (!sourceUrl) sourceUrl = node->subscription->source;
95
 
        nodePtr root = google_source_get_root_from_node (node);
96
 
        google_source_edit_mark_starred ((GoogleSourcePtr)root->data, item->sourceId, sourceUrl, newStatus);
97
 
        item_flag_state_changed(item, newStatus);
98
 
}
99
 
void
100
 
google_source_item_mark_read (nodePtr node, itemPtr item, 
101
 
                              gboolean newStatus)
102
 
{
103
 
        const gchar* sourceUrl = metadata_list_get(item->metadata, "GoogleBroadcastOrigFeed");
104
 
        if (!sourceUrl) sourceUrl = node->subscription->source;
105
 
        nodePtr root = google_source_get_root_from_node (node);
106
 
        google_source_edit_mark_read ((GoogleSourcePtr)root->data, item->sourceId, sourceUrl, newStatus);
107
 
        item_read_state_changed(item, newStatus);
108
 
}
109
 
 
110
89
static void
111
90
google_source_set_orig_source(const xmlNodePtr node, gpointer userdata)
112
91
{
190
169
        itemset_free (itemset);
191
170
        return NULL;
192
171
}
 
172
 
193
173
static void
194
174
google_source_item_retrieve_status (const xmlNodePtr entry, subscriptionPtr subscription, GHashTable *cache)
195
175
{
196
 
        GoogleSourcePtr gsource = (GoogleSourcePtr) google_source_get_root_from_node (subscription->node)->data ;
 
176
        GoogleSourcePtr gsource = (GoogleSourcePtr) node_source_root_from_node (subscription->node)->data ;
197
177
        xmlNodePtr      xml;
198
178
        nodePtr         node = subscription->node;
199
179
        xmlChar         *id;
253
233
                resultCopy->source = g_strdup (result->source); 
254
234
                resultCopy->httpstatus = result->httpstatus;
255
235
                resultCopy->contentType = g_strdup (result->contentType);
256
 
                resultCopy->retriesCount = result->retriesCount ;
257
236
                g_free (resultCopy->updateState);
258
237
                resultCopy->updateState = update_state_copy (result->updateState);
259
238
                
260
239
                /* update the XML by removing 'read', 'reading-list' etc. as labels. */
261
 
                xmlDocPtr doc = xml_parse (result->data, result->size, FALSE, NULL);
 
240
                xmlDocPtr doc = xml_parse (result->data, result->size, NULL);
262
241
                xmlXPathContextPtr xpathCtxt = xmlXPathNewContext (doc) ;
263
242
                xmlXPathRegisterNs (xpathCtxt, "atom", "http://www.w3.org/2005/Atom");
264
243
                google_source_xpath_foreach_match ("/atom:feed/atom:entry/atom:category[@scheme='http://www.google.com/reader/']", xpathCtxt, google_source_xml_unlink_node, NULL);
296
275
           by getting the newCount first and setting it again later. */
297
276
        guint newCount = feedlist_get_new_item_count ();
298
277
 
299
 
        xmlDocPtr doc = xml_parse (result->data, result->size, FALSE, NULL);
 
278
        xmlDocPtr doc = xml_parse (result->data, result->size, NULL);
300
279
        if (doc) {              
301
280
                xmlNodePtr root = xmlDocGetRootElement (doc);
302
281
                xmlNodePtr entry = root->children ; 
325
304
        debug_end_measurement (DEBUG_UPDATE, "time taken to update statuses");
326
305
}
327
306
 
328
 
 
329
 
 
330
307
static gboolean
331
308
google_feed_subscription_prepare_update_request (subscriptionPtr subscription, 
332
309
                                                 struct updateRequest *request)
333
310
{
334
311
        debug0 (DEBUG_UPDATE, "preparing google reader feed subscription for update\n");
335
 
        GoogleSourcePtr gsource = (GoogleSourcePtr) google_source_get_root_from_node (subscription->node)->data; 
 
312
        GoogleSourcePtr gsource = (GoogleSourcePtr) node_source_root_from_node (subscription->node)->data; 
336
313
        
337
314
        g_assert(gsource); 
338
315
        if (gsource->loginState == GOOGLE_SOURCE_STATE_NONE) { 
339
 
                subscription_update (google_source_get_root_from_node (subscription->node)->subscription, 0) ;
 
316
                subscription_update (node_source_root_from_node (subscription->node)->subscription, 0) ;
340
317
                return FALSE;
341
318
        }
342
319
        debug0 (DEBUG_UPDATE, "Setting cookies for a Google Reader subscription");