mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Send Notification when mainWindow will close — remove use of appDelegate property.
This commit is contained in:
@@ -12,6 +12,10 @@ import Articles
|
||||
import Account
|
||||
import RSCore
|
||||
|
||||
extension Notification.Name {
|
||||
static let mainWindowControllerWillClose = Notification.Name("mainWindowControllerWillClose")
|
||||
}
|
||||
|
||||
enum TimelineSourceMode {
|
||||
case regular, search
|
||||
}
|
||||
@@ -524,6 +528,7 @@ final class MainWindowController: NSWindowController, NSUserInterfaceValidations
|
||||
|
||||
// MARK: NSWindowDelegate
|
||||
|
||||
|
||||
extension MainWindowController: NSWindowDelegate {
|
||||
|
||||
func window(_ window: NSWindow, willEncodeRestorableState coder: NSCoder) {
|
||||
@@ -537,9 +542,8 @@ extension MainWindowController: NSWindowDelegate {
|
||||
|
||||
func windowWillClose(_ notification: Notification) {
|
||||
detailViewController?.stopMediaPlayback()
|
||||
appDelegate.removeMainWindow(self)
|
||||
NotificationCenter.default.post(name: .mainWindowControllerWillClose, object: self)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - SidebarDelegate
|
||||
|
||||
Reference in New Issue
Block a user