Remove references to the SidebarSelectionDidChange notification.
This commit is contained in:
parent
9a15068fdd
commit
2574e1bbd7
|
@ -10,7 +10,6 @@ import AppKit
|
|||
import Articles
|
||||
|
||||
extension Notification.Name {
|
||||
static let SidebarSelectionDidChange = Notification.Name("SidebarSelectionDidChangeNotification")
|
||||
static let TimelineSelectionDidChange = Notification.Name("TimelineSelectionDidChangeNotification")
|
||||
static let InspectableObjectsDidChange = Notification.Name("TimelineSelectionDidChangeNotification")
|
||||
static let UserDidAddFeed = Notification.Name("UserDidAddFeedNotification")
|
||||
|
|
|
@ -73,7 +73,6 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
|||
NotificationCenter.default.addObserver(self, selector: #selector(refreshProgressDidChange(_:)), name: .AccountRefreshDidFinish, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(refreshProgressDidChange(_:)), name: .AccountRefreshProgressDidChange, object: nil)
|
||||
|
||||
// NotificationCenter.default.addObserver(self, selector: #selector(sidebarSelectionDidChange(_:)), name: .SidebarSelectionDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange(_:)), name: .DisplayNameDidChange, object: nil)
|
||||
|
||||
|
|
|
@ -282,8 +282,7 @@ protocol SidebarDelegate: class {
|
|||
}
|
||||
|
||||
func outlineViewSelectionDidChange(_ notification: Notification) {
|
||||
|
||||
postSidebarSelectionDidChangeNotification(selectedObjects.isEmpty ? nil : selectedObjects)
|
||||
selectionDidChange(selectedObjects.isEmpty ? nil : selectedObjects)
|
||||
}
|
||||
|
||||
//MARK: - Node Manipulation
|
||||
|
@ -381,19 +380,12 @@ private extension SidebarViewController {
|
|||
outlineView.selectRowIndexes(indexes, byExtendingSelection: false)
|
||||
|
||||
if selectedNodes != nodes && sendNotificationIfChanged {
|
||||
postSidebarSelectionDidChangeNotification(selectedObjects)
|
||||
selectionDidChange(selectedObjects)
|
||||
}
|
||||
}
|
||||
|
||||
func postSidebarSelectionDidChangeNotification(_ selectedObjects: [AnyObject]?) {
|
||||
func selectionDidChange(_ selectedObjects: [AnyObject]?) {
|
||||
delegate?.selectionDidChange(to: selectedObjects)
|
||||
// var userInfo = UserInfoDictionary()
|
||||
// if let objects = selectedObjects {
|
||||
// userInfo[UserInfoKey.objects] = objects
|
||||
// }
|
||||
// userInfo[UserInfoKey.view] = outlineView
|
||||
//
|
||||
// NotificationCenter.default.post(name: .SidebarSelectionDidChange, object: self, userInfo: userInfo)
|
||||
}
|
||||
|
||||
func updateUnreadCounts(for objects: [AnyObject]) {
|
||||
|
|
|
@ -147,7 +147,6 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner {
|
|||
|
||||
if !didRegisterForNotifications {
|
||||
|
||||
// NotificationCenter.default.addObserver(self, selector: #selector(sidebarSelectionDidChange(_:)), name: .SidebarSelectionDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(statusesDidChange(_:)), name: .StatusesDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .FeedIconDidBecomeAvailable, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(avatarDidBecomeAvailable(_:)), name: .AvatarDidBecomeAvailable, object: nil)
|
||||
|
@ -372,23 +371,6 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner {
|
|||
|
||||
// MARK: - Notifications
|
||||
|
||||
// @objc func sidebarSelectionDidChange(_ notification: Notification) {
|
||||
//
|
||||
// guard let userInfo = notification.userInfo else {
|
||||
// return
|
||||
// }
|
||||
// guard let sidebarView = userInfo[UserInfoKey.view] as? NSView, sidebarView.window === tableView.window else {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// if let objects = userInfo[UserInfoKey.objects] as? [AnyObject] {
|
||||
// representedObjects = objects
|
||||
// }
|
||||
// else {
|
||||
// representedObjects = nil
|
||||
// }
|
||||
// }
|
||||
|
||||
@objc func statusesDidChange(_ note: Notification) {
|
||||
|
||||
guard let articles = note.userInfo?[Account.UserInfoKey.articles] as? Set<Article> else {
|
||||
|
|
Loading…
Reference in New Issue