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? { public var isArticleExtractorAlwaysOn: Bool? {
get { get {
if isFeedProvider == true { return false } // not an option for FeedProviders metadata.isArticleExtractorAlwaysOn
return metadata.isArticleExtractorAlwaysOn
} }
set { set {
if isFeedProvider == true {
metadata.isArticleExtractorAlwaysOn = false
return
}
metadata.isArticleExtractorAlwaysOn = newValue metadata.isArticleExtractorAlwaysOn = newValue
} }
} }

View File

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

View File

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

View File

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