mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-18 12:31:01 +01:00
Fix deprecation warnings.
This commit is contained in:
parent
0627f57608
commit
d2afd4582b
@ -8,6 +8,7 @@
|
||||
|
||||
import AppKit
|
||||
import Account
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
struct NNW3ImportController {
|
||||
|
||||
@ -69,7 +70,7 @@ private extension NNW3ImportController {
|
||||
panel.canChooseDirectories = false
|
||||
panel.resolvesAliases = true
|
||||
panel.directoryURL = NNW3ImportController.defaultFileURL
|
||||
panel.allowedFileTypes = ["plist"]
|
||||
panel.allowedContentTypes = [UTType.propertyList]
|
||||
panel.allowsOtherFileTypes = false
|
||||
panel.accessoryView = accessoryViewController.view
|
||||
panel.isAccessoryViewDisclosed = true
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
import Cocoa
|
||||
import os.log
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
class ShareViewController: NSViewController {
|
||||
|
||||
@ -33,14 +34,14 @@ class ShareViewController: NSViewController {
|
||||
// Try to get any HTML that is maybe passed in
|
||||
for item in self.extensionContext!.inputItems as! [NSExtensionItem] {
|
||||
for itemProvider in item.attachments! {
|
||||
if itemProvider.hasItemConformingToTypeIdentifier(kUTTypePropertyList as String) {
|
||||
if itemProvider.hasItemConformingToTypeIdentifier(UTType.propertyList.identifier) {
|
||||
provider = itemProvider
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if provider != nil {
|
||||
provider!.loadItem(forTypeIdentifier: kUTTypePropertyList as String, options: nil, completionHandler: { [weak self] (pList, error) in
|
||||
provider!.loadItem(forTypeIdentifier: UTType.propertyList.identifier, options: nil, completionHandler: { [weak self] (pList, error) in
|
||||
if error != nil {
|
||||
return
|
||||
}
|
||||
|
@ -7,3 +7,9 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
extension UTType {
|
||||
|
||||
static let opml = UTType("public.opml")!
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user