Skip to content

Commit

Permalink
Remove references to isFeedProvider.
Browse files Browse the repository at this point in the history
  • Loading branch information
brentsimmons committed Jun 25, 2023
1 parent 85704ac commit fb51185
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 35 deletions.
7 changes: 1 addition & 6 deletions Account/Sources/Account/WebFeed.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 1 addition & 3 deletions Mac/Inspector/WebFeedInspectorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
14 changes: 2 additions & 12 deletions Mac/MainWindow/MainWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
24 changes: 10 additions & 14 deletions Mac/MainWindow/Sidebar/SidebarViewController+ContextualMenus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit fb51185

Please sign in to comment.