Continue renaming webFeed to feed.

This commit is contained in:
Brent Simmons
2024-11-01 21:58:47 -07:00
parent acabaf8f94
commit fac4eded60
32 changed files with 151 additions and 151 deletions

View File

@@ -59,7 +59,7 @@ class AddFeedViewController: UITableViewController {
nameTextField.text = initialFeedName
nameTextField.delegate = self
if let defaultContainer = AddWebFeedDefaultContainer.defaultContainer {
if let defaultContainer = AddFeedDefaultContainer.defaultContainer {
container = defaultContainer
} else {
addButton.isEnabled = false
@@ -165,7 +165,7 @@ extension AddFeedViewController: AddFeedFolderViewControllerDelegate {
func didSelect(container: Container) {
self.container = container
updateFolderLabel()
AddWebFeedDefaultContainer.saveDefaultContainer(container)
AddFeedDefaultContainer.saveDefaultContainer(container)
}
}

View File

@@ -52,8 +52,8 @@ final class AppDefaults {
static let articleFullscreenEnabled = "articleFullscreenEnabled"
static let confirmMarkAllAsRead = "confirmMarkAllAsRead"
static let lastRefresh = "lastRefresh"
static let addWebFeedAccountID = "addWebFeedAccountID"
static let addWebFeedFolderName = "addWebFeedFolderName"
static let addFeedAccountID = "addFeedAccountID"
static let addFeedFolderName = "addFeedFolderName"
static let addFolderAccountID = "addFolderAccountID"
static let useSystemBrowser = "useSystemBrowser"
static let currentThemeName = "currentThemeName"
@@ -86,21 +86,21 @@ final class AppDefaults {
}
}
var addWebFeedAccountID: String? {
var addFeedAccountID: String? {
get {
return AppDefaults.string(for: Key.addWebFeedAccountID)
return AppDefaults.string(for: Key.addFeedAccountID)
}
set {
AppDefaults.setString(for: Key.addWebFeedAccountID, newValue)
AppDefaults.setString(for: Key.addFeedAccountID, newValue)
}
}
var addWebFeedFolderName: String? {
var addFeedFolderName: String? {
get {
return AppDefaults.string(for: Key.addWebFeedFolderName)
return AppDefaults.string(for: Key.addFeedFolderName)
}
set {
AppDefaults.setString(for: Key.addWebFeedFolderName, newValue)
AppDefaults.setString(for: Key.addFeedFolderName, newValue)
}
}

View File

@@ -21,7 +21,7 @@ class ContextMenuPreviewViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
blogNameLabel.text = article.webFeed?.nameForDisplay ?? ""
blogNameLabel.text = article.feed?.nameForDisplay ?? ""
blogAuthorLabel.text = article.byline()
articleTitleLabel.text = article.title ?? ""

View File

@@ -113,7 +113,7 @@ class WebViewController: UIViewController {
if article != self.article {
self.article = article
if updateView {
if article?.webFeed?.isArticleExtractorAlwaysOn ?? false {
if article?.feed?.isArticleExtractorAlwaysOn ?? false {
startArticleExtractor()
}
windowScrollY = 0
@@ -451,7 +451,7 @@ extension WebViewController: WKScriptMessageHandler {
case MessageName.imageWasClicked:
imageWasClicked(body: message.body as? String)
case MessageName.showFeedInspector:
if let webFeed = article?.webFeed {
if let webFeed = article?.feed {
coordinator.showFeedInspector(for: webFeed)
}
default:

View File

@@ -69,7 +69,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .FeedIconDidBecomeAvailable, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(webFeedSettingDidChange(_:)), name: .WebFeedSettingDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(webFeedSettingDidChange(_:)), name: .FeedSettingDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil)
@@ -137,10 +137,10 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
}
@objc func webFeedSettingDidChange(_ note: Notification) {
guard let webFeed = note.object as? Feed, let key = note.userInfo?[Feed.WebFeedSettingUserInfoKey] as? String else {
guard let webFeed = note.object as? Feed, let key = note.userInfo?[Feed.FeedSettingUserInfoKey] as? String else {
return
}
if key == Feed.WebFeedSettingKey.homePageURL || key == Feed.WebFeedSettingKey.faviconURL {
if key == Feed.FeedSettingKey.homePageURL || key == Feed.FeedSettingKey.faviconURL {
configureCellsForRepresentedObject(webFeed)
}
}

View File

@@ -460,7 +460,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
guard let article = dataSource.itemIdentifier(for: indexPath) else {
return
}
if article.webFeed == feed, let cell = tableView.cellForRow(at: indexPath) as? MasterTimelineTableViewCell, let image = iconImageFor(article) {
if article.feed == feed, let cell = tableView.cellForRow(at: indexPath) as? MasterTimelineTableViewCell, let image = iconImageFor(article) {
cell.setIconImage(image)
}
}
@@ -730,7 +730,7 @@ private extension MasterTimelineViewController {
let showFeedNames = coordinator.showFeedNames
let showIcon = coordinator.showIcons && iconImage != nil
cell.cellData = MasterTimelineCellData(article: article, showFeedName: showFeedNames, feedName: article.webFeed?.nameForDisplay, byline: article.byline(), iconImage: iconImage, showIcon: showIcon, featuredImage: featuredImage, numberOfLines: numberOfTextLines, iconSize: iconSize)
cell.cellData = MasterTimelineCellData(article: article, showFeedName: showFeedNames, feedName: article.feed?.nameForDisplay, byline: article.byline(), iconImage: iconImage, showIcon: showIcon, featuredImage: featuredImage, numberOfLines: numberOfTextLines, iconSize: iconSize)
}
@@ -846,7 +846,7 @@ private extension MasterTimelineViewController {
}
func discloseFeedAction(_ article: Article) -> UIAction? {
guard let webFeed = article.webFeed,
guard let webFeed = article.feed,
!coordinator.timelineFeedIsEqualTo(webFeed) else { return nil }
let title = NSLocalizedString("Go to Feed", comment: "Go to Feed")
@@ -857,7 +857,7 @@ private extension MasterTimelineViewController {
}
func discloseFeedAlertAction(_ article: Article, completion: @escaping (Bool) -> Void) -> UIAlertAction? {
guard let webFeed = article.webFeed,
guard let webFeed = article.feed,
!coordinator.timelineFeedIsEqualTo(webFeed) else { return nil }
let title = NSLocalizedString("Go to Feed", comment: "Go to Feed")
@@ -869,7 +869,7 @@ private extension MasterTimelineViewController {
}
func markAllInFeedAsReadAction(_ article: Article, indexPath: IndexPath) -> UIAction? {
guard let webFeed = article.webFeed else { return nil }
guard let webFeed = article.feed else { return nil }
guard let fetchedArticles = try? webFeed.fetchArticles() else {
return nil
}
@@ -892,7 +892,7 @@ private extension MasterTimelineViewController {
}
func markAllInFeedAsReadAlertAction(_ article: Article, indexPath: IndexPath, completion: @escaping (Bool) -> Void) -> UIAlertAction? {
guard let webFeed = article.webFeed else { return nil }
guard let webFeed = article.feed else { return nil }
guard let fetchedArticles = try? webFeed.fetchArticles() else {
return nil
}

View File

@@ -1197,7 +1197,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
func showFeedInspector() {
let timelineWebFeed = timelineFeed as? Feed
let articleFeed = currentArticle?.webFeed
let articleFeed = currentArticle?.feed
guard let feed = timelineWebFeed ?? articleFeed else {
return
}