Remove references to isFeedProvider.

This commit is contained in:
Brent Simmons 2023-06-25 16:15:21 -07:00
parent 3aeda820e4
commit 7e4c5be30f
4 changed files with 14 additions and 35 deletions

View File

@ -152,14 +152,9 @@ public final class WebFeed: Feed, Renamable, Hashable {
public var isArticleExtractorAlwaysOn: Bool? {
get {
if isFeedProvider == true { return false } // not an option for FeedProviders
return metadata.isArticleExtractorAlwaysOn
metadata.isArticleExtractorAlwaysOn
}
set {
if isFeedProvider == true {
metadata.isArticleExtractorAlwaysOn = false
return
}
metadata.isArticleExtractorAlwaysOn = newValue
}
}

View File

@ -139,10 +139,8 @@ private extension WebFeedInspectorViewController {
updateNotifyAboutNewArticles()
updateIsReaderViewAlwaysOn()
windowTitle = feed?.nameForDisplay ?? NSLocalizedString("Feed Inspector", comment: "Feed Inspector window title")
isReaderViewAlwaysOnCheckBox?.isEnabled = true
view.needsLayout = true
if let webfeed = feed {
webfeed.isFeedProvider ? (isReaderViewAlwaysOnCheckBox?.isEnabled = false) : (isReaderViewAlwaysOnCheckBox?.isEnabled = true)
}
}
func updateImage() {

View File

@ -1145,12 +1145,7 @@ private extension MainWindowController {
}
if let webfeed = currentTimelineViewController?.selectedArticles.first?.webFeed {
if webfeed.isFeedProvider {
toolbarButton.isEnabled = false
return false
} else {
toolbarButton.isEnabled = true
}
toolbarButton.isEnabled = true
}
guard let state = articleExtractor?.state else {
@ -1177,12 +1172,7 @@ private extension MainWindowController {
}
if let webfeed = currentTimelineViewController?.selectedArticles.first?.webFeed {
if webfeed.isFeedProvider {
toolbarButton.isEnabled = false
return false
} else {
toolbarButton.isEnabled = true
}
toolbarButton.isEnabled = true
}
toolbarButton.state = isShowingExtractedArticle ? .on : .off

View File

@ -239,21 +239,17 @@ private extension SidebarViewController {
notificationMenuItem.state = .on
}
menu.addItem(notificationMenuItem)
if !webFeed.isFeedProvider {
let articleExtractorText = NSLocalizedString("Always Use Reader View", comment: "Always Use Reader View")
let articleExtractorMenuItem = menuItem(articleExtractorText, #selector(toggleArticleExtractorFromContextMenu(_:)), webFeed)
if webFeed.isArticleExtractorAlwaysOn == nil || webFeed.isArticleExtractorAlwaysOn! == false {
articleExtractorMenuItem.state = .off
} else {
articleExtractorMenuItem.state = .on
}
menu.addItem(articleExtractorMenuItem)
let articleExtractorText = NSLocalizedString("Always Use Reader View", comment: "Always Use Reader View")
let articleExtractorMenuItem = menuItem(articleExtractorText, #selector(toggleArticleExtractorFromContextMenu(_:)), webFeed)
if webFeed.isArticleExtractorAlwaysOn == nil || webFeed.isArticleExtractorAlwaysOn! == false {
articleExtractorMenuItem.state = .off
} else {
articleExtractorMenuItem.state = .on
}
menu.addItem(articleExtractorMenuItem)
menu.addItem(NSMenuItem.separator())
menu.addItem(renameMenuItem(webFeed))