Make has(feed) a Container protocol method.
This commit is contained in:
parent
edd9b1cc91
commit
fe2d329301
|
@ -615,10 +615,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func has(_ feed: Feed) -> Bool {
|
|
||||||
return flattenedFeeds().contains(feed)
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - Container
|
// MARK: - Container
|
||||||
|
|
||||||
public func flattenedFeeds() -> Set<Feed> {
|
public func flattenedFeeds() -> Set<Feed> {
|
||||||
|
@ -653,6 +649,10 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
||||||
postChildrenDidChangeNotification()
|
postChildrenDidChangeNotification()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func has(_ feed: Feed) -> Bool {
|
||||||
|
return flattenedFeeds().contains(feed)
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Debug
|
// MARK: - Debug
|
||||||
|
|
||||||
public func debugDropConditionalGetInfo() {
|
public func debugDropConditionalGetInfo() {
|
||||||
|
|
|
@ -33,6 +33,7 @@ public protocol Container: class {
|
||||||
|
|
||||||
//Recursive — checks subfolders
|
//Recursive — checks subfolders
|
||||||
func flattenedFeeds() -> Set<Feed>
|
func flattenedFeeds() -> Set<Feed>
|
||||||
|
func has(_ feed: Feed) -> Bool
|
||||||
func hasFeed(with feedID: String) -> Bool
|
func hasFeed(with feedID: String) -> Bool
|
||||||
func hasFeed(withURL url: String) -> Bool
|
func hasFeed(withURL url: String) -> Bool
|
||||||
func existingFeed(with feedID: String) -> Feed?
|
func existingFeed(with feedID: String) -> Feed?
|
||||||
|
|
|
@ -101,7 +101,11 @@ public final class Folder: DisplayNameProvider, Renamable, Container, UnreadCoun
|
||||||
topLevelFeeds.remove(feed)
|
topLevelFeeds.remove(feed)
|
||||||
postChildrenDidChangeNotification()
|
postChildrenDidChangeNotification()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func has(_ feed: Feed) -> Bool {
|
||||||
|
return flattenedFeeds().contains(feed)
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Hashable
|
// MARK: - Hashable
|
||||||
|
|
||||||
public func hash(into hasher: inout Hasher) {
|
public func hash(into hasher: inout Hasher) {
|
||||||
|
|
Loading…
Reference in New Issue