Fix deprecation warnings related to UTIs.

This commit is contained in:
Brent Simmons
2024-11-03 21:31:40 -08:00
parent 69dc583c3f
commit 813500b55a
7 changed files with 41 additions and 43 deletions

View File

@@ -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
@@ -104,3 +105,8 @@ class ImportOPMLWindowController: NSWindowController {
}
}
extension UTType {
static let opml = UTType("public.opml")!
}