mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Implement active account processing functionality
This commit is contained in:
@@ -34,7 +34,7 @@ extension SearchFeedDelegate: ArticleFetcher {
|
||||
|
||||
func fetchArticles() -> Set<Article> {
|
||||
var articles = Set<Article>()
|
||||
for account in AccountManager.shared.accounts {
|
||||
for account in AccountManager.shared.activeAccounts {
|
||||
articles.formUnion(account.fetchArticlesMatching(searchString))
|
||||
}
|
||||
return articles
|
||||
|
||||
@@ -51,7 +51,7 @@ final class SmartFeed: PseudoFeed {
|
||||
}
|
||||
|
||||
@objc func fetchUnreadCounts() {
|
||||
AccountManager.shared.accounts.forEach { self.fetchUnreadCount(for: $0) }
|
||||
AccountManager.shared.activeAccounts.forEach { self.fetchUnreadCount(for: $0) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ private extension SmartFeed {
|
||||
}
|
||||
|
||||
func updateUnreadCount() {
|
||||
unreadCount = AccountManager.shared.accounts.reduce(0) { (result, account) -> Int in
|
||||
unreadCount = AccountManager.shared.activeAccounts.reduce(0) { (result, account) -> Int in
|
||||
if let oneUnreadCount = unreadCounts[account] {
|
||||
return result + oneUnreadCount
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ struct StarredFeedDelegate: SmartFeedDelegate {
|
||||
func fetchArticles() -> Set<Article> {
|
||||
|
||||
var articles = Set<Article>()
|
||||
for account in AccountManager.shared.accounts {
|
||||
for account in AccountManager.shared.activeAccounts {
|
||||
articles.formUnion(account.fetchStarredArticles())
|
||||
}
|
||||
return articles
|
||||
|
||||
@@ -24,7 +24,7 @@ struct TodayFeedDelegate: SmartFeedDelegate {
|
||||
func fetchArticles() -> Set<Article> {
|
||||
|
||||
var articles = Set<Article>()
|
||||
for account in AccountManager.shared.accounts {
|
||||
for account in AccountManager.shared.activeAccounts {
|
||||
articles.formUnion(account.fetchTodayArticles())
|
||||
}
|
||||
return articles
|
||||
|
||||
@@ -57,7 +57,7 @@ extension UnreadFeed: ArticleFetcher {
|
||||
func fetchUnreadArticles() -> Set<Article> {
|
||||
|
||||
var articles = Set<Article>()
|
||||
for account in AccountManager.shared.accounts {
|
||||
for account in AccountManager.shared.activeAccounts {
|
||||
articles.formUnion(account.fetchUnreadArticles())
|
||||
}
|
||||
return articles
|
||||
|
||||
@@ -113,7 +113,7 @@ private extension FeedTreeControllerDelegate {
|
||||
|
||||
func sortedAccountNodes(_ parent: Node) -> [Node] {
|
||||
|
||||
let nodes = AccountManager.shared.sortedAccounts.map { (account) -> Node in
|
||||
let nodes = AccountManager.shared.sortedActiveAccounts.map { (account) -> Node in
|
||||
let accountNode = parent.existingOrNewChildNode(with: account)
|
||||
accountNode.canHaveChildNodes = true
|
||||
accountNode.isGroupItem = true
|
||||
|
||||
@@ -24,7 +24,7 @@ private extension FolderTreeControllerDelegate {
|
||||
|
||||
func childNodesForRootNode(_ node: Node) -> [Node]? {
|
||||
|
||||
let accountNodes: [Node] = AccountManager.shared.accounts.map { account in
|
||||
let accountNodes: [Node] = AccountManager.shared.activeAccounts.map { account in
|
||||
let accountNode = Node(representedObject: account, parent: node)
|
||||
accountNode.canHaveChildNodes = true
|
||||
return accountNode
|
||||
|
||||
Reference in New Issue
Block a user