mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-20 14:33:04 +01:00
Make the UnreadFeed conform to ArticleFetcher. It now displays articles in the timeline when selected.
This commit is contained in:
parent
00cf3934e5
commit
f5bfadfb33
@ -679,11 +679,8 @@ private extension TimelineViewController {
|
|||||||
|
|
||||||
for object in representedObjects {
|
for object in representedObjects {
|
||||||
|
|
||||||
if let feed = object as? Feed {
|
if let articleFetcher = object as? ArticleFetcher {
|
||||||
fetchedArticles.formUnion(feed.fetchArticles())
|
fetchedArticles.formUnion(articleFetcher.fetchArticles())
|
||||||
}
|
|
||||||
else if let folder = object as? Folder {
|
|
||||||
fetchedArticles.formUnion(folder.fetchArticles())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import Account
|
||||||
|
import Data
|
||||||
|
|
||||||
// This just shows the global unread count, which appDelegate already has. Easy.
|
// This just shows the global unread count, which appDelegate already has. Easy.
|
||||||
|
|
||||||
@ -34,3 +36,20 @@ final class UnreadFeed: PseudoFeed {
|
|||||||
unreadCount = appDelegate.unreadCount
|
unreadCount = appDelegate.unreadCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension UnreadFeed: ArticleFetcher {
|
||||||
|
|
||||||
|
func fetchArticles() -> Set<Article> {
|
||||||
|
|
||||||
|
return fetchUnreadArticles()
|
||||||
|
}
|
||||||
|
|
||||||
|
func fetchUnreadArticles() -> Set<Article> {
|
||||||
|
|
||||||
|
var articles = Set<Article>()
|
||||||
|
for account in AccountManager.shared.accounts {
|
||||||
|
articles.formUnion(account.fetchUnreadArticles())
|
||||||
|
}
|
||||||
|
return articles
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user