Remove references to the no-longer-used TimelineSelectionDidChange notification.
This commit is contained in:
parent
f2d98c9581
commit
74b3ecdab8
|
@ -10,7 +10,6 @@ import AppKit
|
|||
import Articles
|
||||
|
||||
extension Notification.Name {
|
||||
static let TimelineSelectionDidChange = Notification.Name("TimelineSelectionDidChangeNotification")
|
||||
static let InspectableObjectsDidChange = Notification.Name("TimelineSelectionDidChangeNotification")
|
||||
static let UserDidAddFeed = Notification.Name("UserDidAddFeedNotification")
|
||||
static let UserDidRequestSidebarSelection = Notification.Name("UserDidRequestSidebarSelectionNotification")
|
||||
|
|
|
@ -35,7 +35,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner {
|
|||
showFeedNames = false
|
||||
}
|
||||
|
||||
postTimelineSelectionDidChangeNotification(nil)
|
||||
selectionDidChange(nil)
|
||||
fetchArticles()
|
||||
if articles.count > 0 {
|
||||
tableView.scrollRowToVisible(0)
|
||||
|
@ -633,9 +633,8 @@ extension TimelineViewController: NSTableViewDelegate {
|
|||
}
|
||||
|
||||
func tableViewSelectionDidChange(_ notification: Notification) {
|
||||
|
||||
if selectedArticles.isEmpty {
|
||||
postTimelineSelectionDidChangeNotification(nil)
|
||||
selectionDidChange(nil)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -646,30 +645,18 @@ extension TimelineViewController: NSTableViewDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
postTimelineSelectionDidChangeNotification(selectedArticles)
|
||||
selectionDidChange(selectedArticles)
|
||||
|
||||
self.invalidateRestorableState()
|
||||
}
|
||||
|
||||
private func postTimelineSelectionDidChangeNotification(_ selectedArticles: ArticleArray?) {
|
||||
|
||||
private func selectionDidChange(_ selectedArticles: ArticleArray?) {
|
||||
delegate?.timelineSelectionDidChange(self, selectedArticles: selectedArticles)
|
||||
|
||||
var userInfo = UserInfoDictionary()
|
||||
if let selectedArticles = selectedArticles {
|
||||
userInfo[UserInfoKey.articles] = selectedArticles
|
||||
}
|
||||
userInfo[UserInfoKey.view] = tableView
|
||||
|
||||
NotificationCenter.default.post(name: .TimelineSelectionDidChange, object: self, userInfo: userInfo)
|
||||
|
||||
}
|
||||
|
||||
private func configureTimelineCell(_ cell: TimelineTableCellView, article: Article) {
|
||||
|
||||
cell.objectValue = article
|
||||
|
||||
// let favicon = showFeedNames ? article.feed?.smallIcon : nil
|
||||
var avatar = avatarFor(article)
|
||||
if avatar == nil, let feed = article.feed {
|
||||
avatar = appDelegate.faviconDownloader.favicon(for: feed)
|
||||
|
@ -680,7 +667,6 @@ extension TimelineViewController: NSTableViewDelegate {
|
|||
}
|
||||
|
||||
private func avatarFor(_ article: Article) -> NSImage? {
|
||||
|
||||
if !showAvatars {
|
||||
return nil
|
||||
}
|
||||
|
@ -700,7 +686,6 @@ extension TimelineViewController: NSTableViewDelegate {
|
|||
}
|
||||
|
||||
private func avatarForAuthor(_ author: Author) -> NSImage? {
|
||||
|
||||
return appDelegate.authorAvatarDownloader.image(for: author)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue