diff options
author | Jan Lukas Gernert <jangernert@gmail.com> | 2017-10-14 18:57:34 +0300 |
---|---|---|
committer | Jan Lukas Gernert <jangernert@gmail.com> | 2017-10-14 18:57:34 +0300 |
commit | c55d6fec7fe6cfab7411ce169ef3d7fdb19db6d0 (patch) | |
tree | 667444e8b0eaa9eccbd642f57c943ac9d78a3c14 | |
parent | 35eed6e6dc3b6401f59ff29b950803f547788e20 (diff) |
dont download favicons during sync anymore
-rw-r--r-- | plugins/backend/local/SuggestedFeedRow.vala | 11 | ||||
-rw-r--r-- | src/Backend/FeedServer.vala | 28 | ||||
-rw-r--r-- | src/FavIconManager.vala | 6 |
3 files changed, 6 insertions, 39 deletions
diff --git a/plugins/backend/local/SuggestedFeedRow.vala b/plugins/backend/local/SuggestedFeedRow.vala index 9e8f1e2d..64da8d01 100644 --- a/plugins/backend/local/SuggestedFeedRow.vala +++ b/plugins/backend/local/SuggestedFeedRow.vala @@ -70,15 +70,10 @@ public class FeedReader.SuggestedFeedRow : Gtk.ListBoxRow { private async void load_favicon(Gtk.Stack iconStack, Feed feed, string iconURL) { - bool success = yield FavIconManager.get_default().downloadFavIcon(feed, iconURL); - Gtk.Image? icon = null; - if(success) - { - var pixBuf = yield FavIconManager.get_default().getIcon(feed); - if(pixBuf != null) - icon = new Gtk.Image.from_pixbuf(pixBuf); - } + var pixBuf = yield FavIconManager.get_default().getIcon(feed); + if(pixBuf != null) + icon = new Gtk.Image.from_pixbuf(pixBuf); if(icon == null) { diff --git a/src/Backend/FeedServer.vala b/src/Backend/FeedServer.vala index 85034b5e..feded383 100644 --- a/src/Backend/FeedServer.vala +++ b/src/Backend/FeedServer.vala @@ -164,20 +164,6 @@ public class FeedReader.FeedServer : GLib.Object { DataBase.writeAccess().delete_nonexisting_tags(); FeedReaderBackend.get_default().newFeedList(); - - // download favicons for all feeds - FavIconManager.get_default().getFavIcons.begin(feeds, cancellable, (obj, res) => { - FavIconManager.get_default().getFavIcons.end(res); - FeedReaderBackend.get_default().reloadFavIcons(); - }); - } - else - { - // download favicons for all feeds - FavIconManager.get_default().getFavIcons.begin(DataBase.readOnly().read_feeds(), cancellable, (obj, res) => { - FavIconManager.get_default().getFavIcons.end(res); - FeedReaderBackend.get_default().reloadFavIcons(); - }); } if(cancellable != null && cancellable.is_cancelled()) @@ -271,20 +257,6 @@ public class FeedReader.FeedServer : GLib.Object { DataBase.writeAccess().write_tags(tags); FeedReaderBackend.get_default().newFeedList(); - - // download favicons for all feeds - FavIconManager.get_default().getFavIcons.begin(feeds, cancellable, (obj, res) => { - FavIconManager.get_default().getFavIcons.end(res); - FeedReaderBackend.get_default().reloadFavIcons(); - }); - } - else - { - // download favicons for all feeds - FavIconManager.get_default().getFavIcons.begin(DataBase.readOnly().read_feeds(), cancellable, (obj, res) => { - FavIconManager.get_default().getFavIcons.end(res); - FeedReaderBackend.get_default().reloadFavIcons(); - }); } if(cancellable != null && cancellable.is_cancelled()) diff --git a/src/FavIconManager.vala b/src/FavIconManager.vala index 2974fbe7..04817def 100644 --- a/src/FavIconManager.vala +++ b/src/FavIconManager.vala @@ -89,7 +89,7 @@ public class FeedReader.FavIconManager : GLib.Object { return null; } - public async void getFavIcons(Gee.List<Feed> feeds, GLib.Cancellable? cancellable = null) + private async void getFavIcons(Gee.List<Feed> feeds, GLib.Cancellable? cancellable = null) { // TODO: It would be nice if we could queue these in parallel foreach(Feed f in feeds) @@ -105,7 +105,7 @@ public class FeedReader.FavIconManager : GLib.Object { } } - public async bool downloadFavIcon(Feed feed, string? hint_url = null, GLib.Cancellable? cancellable = null, string icon_path = GLib.Environment.get_user_data_dir() + "/feedreader/data/feed_icons/") + private async bool downloadFavIcon(Feed feed, string? hint_url = null, GLib.Cancellable? cancellable = null, string icon_path = GLib.Environment.get_user_data_dir() + "/feedreader/data/feed_icons/") { string filename_prefix = icon_path + feed.getFeedFileName(); string local_filename = @"$filename_prefix.ico"; @@ -210,7 +210,7 @@ public class FeedReader.FavIconManager : GLib.Object { return false; } - public async bool downloadIcon(Feed feed, string? icon_url, Cancellable? cancellable, string icon_path = GLib.Environment.get_user_data_dir() + "/feedreader/data/feed_icons/") + private async bool downloadIcon(Feed feed, string? icon_url, Cancellable? cancellable, string icon_path = GLib.Environment.get_user_data_dir() + "/feedreader/data/feed_icons/") { if(icon_url == "" || icon_url == null || GLib.Uri.parse_scheme(icon_url) == null) { |