Continue renaming webFeed to feed.

This commit is contained in:
Brent Simmons
2024-11-01 22:09:22 -07:00
parent fac4eded60
commit 2d3ef95619
40 changed files with 286 additions and 286 deletions

View File

@@ -99,7 +99,7 @@ class AddFeedViewController: UITableViewController {
account = containerAccount
}
if account!.hasWebFeed(withURL: url.absoluteString) {
if account!.hasFeed(withURL: url.absoluteString) {
presentError(AccountError.createErrorAlreadySubscribed)
return
}
@@ -112,14 +112,14 @@ class AddFeedViewController: UITableViewController {
BatchUpdate.shared.start()
account!.createWebFeed(url: url.absoluteString, name: feedName, container: container, validateFeed: true) { result in
account!.createFeed(url: url.absoluteString, name: feedName, container: container, validateFeed: true) { result in
BatchUpdate.shared.end()
switch result {
case .success(let feed):
self.dismiss(animated: true)
NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.webFeed: feed])
NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.feed: feed])
case .failure(let error):
self.addButton.isEnabled = true
self.activityIndicator.isHidden = true

View File

@@ -32,7 +32,7 @@ extension MasterFeedViewController: UITableViewDropDelegate {
if destAccount.behaviors.contains(.disallowFeedInMultipleFolders),
let sourceNode = session.localDragSession?.items.first?.localObject as? Node,
let sourceWebFeed = sourceNode.representedObject as? Feed,
sourceWebFeed.account?.accountID != destAccount.accountID && destAccount.hasWebFeed(withURL: sourceWebFeed.url) {
sourceWebFeed.account?.accountID != destAccount.accountID && destAccount.hasFeed(withURL: sourceWebFeed.url) {
return UITableViewDropProposal(operation: .forbidden)
}
@@ -104,7 +104,7 @@ extension MasterFeedViewController: UITableViewDropDelegate {
guard sourceContainer !== destinationContainer else { return }
BatchUpdate.shared.start()
sourceContainer.account?.moveWebFeed(feed, from: sourceContainer, to: destinationContainer) { result in
sourceContainer.account?.moveFeed(feed, from: sourceContainer, to: destinationContainer) { result in
BatchUpdate.shared.end()
switch result {
case .success:
@@ -117,10 +117,10 @@ extension MasterFeedViewController: UITableViewDropDelegate {
func moveWebFeedBetweenAccounts(feed: Feed, sourceContainer: Container, destinationContainer: Container) {
if let existingFeed = destinationContainer.account?.existingWebFeed(withURL: feed.url) {
if let existingFeed = destinationContainer.account?.existingFeed(withURL: feed.url) {
BatchUpdate.shared.start()
destinationContainer.account?.addWebFeed(existingFeed, to: destinationContainer) { result in
destinationContainer.account?.addFeed(existingFeed, to: destinationContainer) { result in
switch result {
case .success:
sourceContainer.account?.removeWebFeed(feed, from: sourceContainer) { result in
@@ -141,7 +141,7 @@ extension MasterFeedViewController: UITableViewDropDelegate {
} else {
BatchUpdate.shared.start()
destinationContainer.account?.createWebFeed(url: feed.url, name: feed.editedName, container: destinationContainer, validateFeed: false) { result in
destinationContainer.account?.createFeed(url: feed.url, name: feed.editedName, container: destinationContainer, validateFeed: false) { result in
switch result {
case .success:
sourceContainer.account?.removeWebFeed(feed, from: sourceContainer) { result in

View File

@@ -130,7 +130,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
}
@objc func webFeedIconDidBecomeAvailable(_ note: Notification) {
guard let webFeed = note.userInfo?[UserInfoKey.webFeed] as? Feed else {
guard let webFeed = note.userInfo?[UserInfoKey.feed] as? Feed else {
return
}
applyToCellsForRepresentedObject(webFeed, configureIcon(_:_:))

View File

@@ -453,7 +453,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
titleView.iconView.iconImage = coordinator.timelineIconImage
}
guard let feed = note.userInfo?[UserInfoKey.webFeed] as? Feed else {
guard let feed = note.userInfo?[UserInfoKey.feed] as? Feed else {
return
}
tableView.indexPathsForVisibleRows?.forEach { indexPath in

View File

@@ -127,7 +127,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
var prefersStatusBarHidden = false
private let treeControllerDelegate = WebFeedTreeControllerDelegate()
private let treeControllerDelegate = FeedTreeControllerDelegate()
private let treeController: TreeController
var stateRestorationActivity: NSUserActivity {
@@ -545,7 +545,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
}
@objc func userDidAddFeed(_ notification: Notification) {
guard let webFeed = notification.userInfo?[UserInfoKey.webFeed] as? Feed else {
guard let webFeed = notification.userInfo?[UserInfoKey.feed] as? Feed else {
return
}
discloseWebFeed(webFeed, animations: [.scroll, .navigation])
@@ -1477,7 +1477,7 @@ private extension SceneCoordinator {
treeControllerDelegate.addFilterException(feedID)
}
} else if let webFeed = feed as? Feed {
if webFeed.account?.existingWebFeed(withWebFeedID: webFeed.webFeedID) != nil {
if webFeed.account?.existingWebFeed(withWebFeedID: webFeed.feedID) != nil {
treeControllerDelegate.addFilterException(feedID)
addParentFolderToFilterExceptions(webFeed)
}
@@ -2080,13 +2080,13 @@ private extension SceneCoordinator {
if let feed = timelineFeed as? Feed {
for oneFeed in feeds {
if feed.webFeedID == oneFeed.webFeedID || feed.url == oneFeed.url {
if feed.feedID == oneFeed.feedID || feed.url == oneFeed.url {
return true
}
}
} else if let folder = timelineFeed as? Folder {
for oneFeed in feeds {
if folder.hasWebFeed(with: oneFeed.webFeedID) || folder.hasWebFeed(withURL: oneFeed.url) {
if folder.hasWebFeed(with: oneFeed.feedID) || folder.hasFeed(withURL: oneFeed.url) {
return true
}
}
@@ -2379,7 +2379,7 @@ private extension SceneCoordinator {
}
func findWebFeedNode(webFeedID: String, beginningAt startingNode: Node) -> Node? {
if let node = startingNode.descendantNode(where: { ($0.representedObject as? Feed)?.webFeedID == webFeedID }) {
if let node = startingNode.descendantNode(where: { ($0.representedObject as? Feed)?.feedID == webFeedID }) {
return node
}
return nil