made the feedmodel respect the has_icon setting, when this si reported by the api. closes #146

This commit is contained in:
Hauke Schade 2015-01-03 14:56:47 +01:00
parent 89036d6b1c
commit da459c2026
2 changed files with 12 additions and 1 deletions

View file

@ -103,7 +103,7 @@ ListModel {
feedId: parseInt(feeds[feed].id),
categoryId: parseInt(feeds[feed].cat_id),
isCat: false,
icon: settings.displayIcons ? ttrss.getIconUrl(feeds[feed].id) : ''
icon: settings.displayIcons ? feeds[feed].icon_url : '',
lastUpdated: formatedDate
})
totalUnreadCount += parseInt(feeds[feed].unread)

View file

@ -572,6 +572,17 @@ function process_updateFeeds(callback, httpreq) {
var feedid = response.content[i].id;
state['categoryfeeds'][catId][i] = feedid;
state['feedcache'][feedid] = response.content[i];
// render the icon url
state['feedcache'][feedid]['icon_url'] = getIconUrl(feedid)
if (state['feedcache'][feedid]['has_icon'] !== undefined) {
if (!state['feedcache'][feedid]['has_icon']) {
var localstring = "qrc:///images"
var iconurl = state['feedcache'][feedid]['icon_url']
if (iconurl.substring(localstring.length) !== localstring) {
state['feedcache'][feedid]['icon_url'] = ''
}
}
}
}
if(state['categoryfeeds'][catId] && !processPendingRequests(callback)