From 93e76f617be7cadaa6ce2da3724b0baa82420dd0 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 25 Apr 2025 08:46:34 -0700 Subject: [PATCH] Fix several warnings. --- Mac/MainWindow/Detail/DetailWebViewController.swift | 2 +- Mac/MainWindow/NNW3/NNW3ImportController.swift | 2 +- Mac/MainWindow/OPML/ExportOPMLWindowController.swift | 3 ++- Mac/MainWindow/OPML/ImportOPMLWindowController.swift | 3 ++- Mac/MainWindow/Sidebar/PasteboardFolder.swift | 2 +- Mac/MainWindow/Sidebar/PasteboardWebFeed.swift | 2 +- Mac/MainWindow/Timeline/Cell/TimelineCellAppearance.swift | 2 +- Modules/RSTree/Sources/RSTree/TreeController.swift | 4 ++-- 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Mac/MainWindow/Detail/DetailWebViewController.swift b/Mac/MainWindow/Detail/DetailWebViewController.swift index cc2585691..c4ca44916 100644 --- a/Mac/MainWindow/Detail/DetailWebViewController.swift +++ b/Mac/MainWindow/Detail/DetailWebViewController.swift @@ -7,7 +7,7 @@ // import AppKit -import WebKit +@preconcurrency import WebKit import RSCore import RSWeb import Articles diff --git a/Mac/MainWindow/NNW3/NNW3ImportController.swift b/Mac/MainWindow/NNW3/NNW3ImportController.swift index 32084490e..c54a77c76 100644 --- a/Mac/MainWindow/NNW3/NNW3ImportController.swift +++ b/Mac/MainWindow/NNW3/NNW3ImportController.swift @@ -69,7 +69,7 @@ private extension NNW3ImportController { panel.canChooseDirectories = false panel.resolvesAliases = true panel.directoryURL = NNW3ImportController.defaultFileURL - panel.allowedFileTypes = ["plist"] + panel.allowedContentTypes = [.propertyList] panel.allowsOtherFileTypes = false panel.accessoryView = accessoryViewController.view panel.isAccessoryViewDisclosed = true diff --git a/Mac/MainWindow/OPML/ExportOPMLWindowController.swift b/Mac/MainWindow/OPML/ExportOPMLWindowController.swift index 4b2ce20a6..2d2ac30cf 100644 --- a/Mac/MainWindow/OPML/ExportOPMLWindowController.swift +++ b/Mac/MainWindow/OPML/ExportOPMLWindowController.swift @@ -8,6 +8,7 @@ import AppKit import Account +import UniformTypeIdentifiers class ExportOPMLWindowController: NSWindowController { @@ -75,7 +76,7 @@ class ExportOPMLWindowController: NSWindowController { func exportOPML(account: Account) { let panel = NSSavePanel() - panel.allowedFileTypes = ["opml"] + panel.allowedContentTypes = [UTType.opml] panel.allowsOtherFileTypes = false panel.prompt = NSLocalizedString("Export OPML", comment: "Export OPML") panel.title = NSLocalizedString("Export OPML", comment: "Export OPML") diff --git a/Mac/MainWindow/OPML/ImportOPMLWindowController.swift b/Mac/MainWindow/OPML/ImportOPMLWindowController.swift index f0737fe93..1db6ca6d2 100644 --- a/Mac/MainWindow/OPML/ImportOPMLWindowController.swift +++ b/Mac/MainWindow/OPML/ImportOPMLWindowController.swift @@ -8,6 +8,7 @@ import AppKit import Account +import UniformTypeIdentifiers class ImportOPMLWindowController: NSWindowController { @@ -85,7 +86,7 @@ class ImportOPMLWindowController: NSWindowController { panel.allowsMultipleSelection = false panel.canChooseDirectories = false panel.resolvesAliases = true - panel.allowedFileTypes = ["opml", "xml"] + panel.allowedContentTypes = [UTType.opml, UTType.xml] panel.allowsOtherFileTypes = false panel.beginSheetModal(for: hostWindow!) { modalResult in diff --git a/Mac/MainWindow/Sidebar/PasteboardFolder.swift b/Mac/MainWindow/Sidebar/PasteboardFolder.swift index 60c42154c..0ffd6c08b 100644 --- a/Mac/MainWindow/Sidebar/PasteboardFolder.swift +++ b/Mac/MainWindow/Sidebar/PasteboardFolder.swift @@ -84,7 +84,7 @@ struct PasteboardFolder: Hashable { } } -extension Folder: PasteboardWriterOwner { +extension Folder: @retroactive PasteboardWriterOwner { public var pasteboardWriter: NSPasteboardWriting { return FolderPasteboardWriter(folder: self) diff --git a/Mac/MainWindow/Sidebar/PasteboardWebFeed.swift b/Mac/MainWindow/Sidebar/PasteboardWebFeed.swift index 31612ded9..f0c838c47 100644 --- a/Mac/MainWindow/Sidebar/PasteboardWebFeed.swift +++ b/Mac/MainWindow/Sidebar/PasteboardWebFeed.swift @@ -146,7 +146,7 @@ struct PasteboardWebFeed: Hashable { } } -extension WebFeed: PasteboardWriterOwner { +extension WebFeed: @retroactive PasteboardWriterOwner { public var pasteboardWriter: NSPasteboardWriting { return WebFeedPasteboardWriter(webFeed: self) diff --git a/Mac/MainWindow/Timeline/Cell/TimelineCellAppearance.swift b/Mac/MainWindow/Timeline/Cell/TimelineCellAppearance.swift index b288ff911..dbfdf045b 100644 --- a/Mac/MainWindow/Timeline/Cell/TimelineCellAppearance.swift +++ b/Mac/MainWindow/Timeline/Cell/TimelineCellAppearance.swift @@ -67,7 +67,7 @@ struct TimelineCellAppearance: Equatable { } } -extension NSEdgeInsets: Equatable { +extension NSEdgeInsets: @retroactive Equatable { public static func ==(lhs: NSEdgeInsets, rhs: NSEdgeInsets) -> Bool { return lhs.left == rhs.left && lhs.top == rhs.top && lhs.right == rhs.right && lhs.bottom == rhs.bottom diff --git a/Modules/RSTree/Sources/RSTree/TreeController.swift b/Modules/RSTree/Sources/RSTree/TreeController.swift index 6475f9a60..84178243e 100644 --- a/Modules/RSTree/Sources/RSTree/TreeController.swift +++ b/Modules/RSTree/Sources/RSTree/TreeController.swift @@ -8,8 +8,8 @@ import Foundation -public protocol TreeControllerDelegate: class { - +public protocol TreeControllerDelegate: AnyObject { + func treeController(treeController: TreeController, childNodesFor: Node) -> [Node]? }