From 74b3ecdab845d93e4ef17b6f7f89e9735dc7d752 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 18 Feb 2019 14:54:38 -0800 Subject: [PATCH] Remove references to the no-longer-used TimelineSelectionDidChange notification. --- NetNewsWire/AppNotifications.swift | 1 - .../Timeline/TimelineViewController.swift | 23 ++++--------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/NetNewsWire/AppNotifications.swift b/NetNewsWire/AppNotifications.swift index 107e2befc..a5b78d8b5 100644 --- a/NetNewsWire/AppNotifications.swift +++ b/NetNewsWire/AppNotifications.swift @@ -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") diff --git a/NetNewsWire/MainWindow/Timeline/TimelineViewController.swift b/NetNewsWire/MainWindow/Timeline/TimelineViewController.swift index 3f6c02fad..174477134 100644 --- a/NetNewsWire/MainWindow/Timeline/TimelineViewController.swift +++ b/NetNewsWire/MainWindow/Timeline/TimelineViewController.swift @@ -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) }