Fix several warnings.

This commit is contained in:
Brent Simmons
2025-04-25 08:55:50 -07:00
parent 93e76f617b
commit c43776ae36
7 changed files with 9 additions and 8 deletions

View File

@@ -10,7 +10,7 @@ import AppKit
import Articles
import RSCore
extension Article: PasteboardWriterOwner {
extension Article: @retroactive PasteboardWriterOwner {
public var pasteboardWriter: NSPasteboardWriting {
return ArticlePasteboardWriter(article: self)
}

View File

@@ -222,7 +222,7 @@ struct AddAccountsView: View {
.padding(.top, 8)
HStack {
ForEach(0..<chunkedWebAccounts().count, content: { chunk in
ForEach(0..<chunkedWebAccounts().count, id: \.self, content: { chunk in
VStack {
Picker(selection: $selectedAccount, label: Text(""), content: {
ForEach(chunkedWebAccounts()[chunk], id: \.self, content: { account in

View File

@@ -10,6 +10,7 @@ import AppKit
import RSCore
import RSWeb
import UserNotifications
import UniformTypeIdentifiers
final class GeneralPreferencesViewController: NSViewController {
@@ -125,7 +126,7 @@ private extension GeneralPreferencesViewController {
let item = NSMenuItem(title: name, action: nil, keyEquivalent: "")
item.representedObject = browser.bundleIdentifier
let icon = browser.icon ?? NSWorkspace.shared.icon(forFileType: kUTTypeApplicationBundle as String)
let icon = browser.icon ?? NSWorkspace.shared.icon(for: UTType.applicationBundle)
icon.size = NSSize(width: 16.0, height: 16.0)
item.image = browser.icon
menu.addItem(item)

View File

@@ -10,7 +10,7 @@ import AppKit
//let keypadEnter: unichar = 3
@objc public protocol KeyboardDelegate: class {
@objc public protocol KeyboardDelegate: AnyObject {
// Return true if handled.
func keydown(_: NSEvent, in view: NSView) -> Bool

View File

@@ -15,7 +15,7 @@ import Foundation
/// When its canceled, it should do its best to stop
/// doing whatever its doing. However, it should not
/// leave data in an inconsistent state.
public protocol MainThreadOperation: class {
public protocol MainThreadOperation: AnyObject {
// These three properties are set by MainThreadOperationQueue. Dont set them.
var isCanceled: Bool { get set } // Check this at appropriate times in case the operation has been canceled.

View File

@@ -8,7 +8,7 @@
import Foundation
public protocol MainThreadOperationDelegate: class {
public protocol MainThreadOperationDelegate: AnyObject {
func operationDidComplete(_ operation: MainThreadOperation)
func cancelOperation(_ operation: MainThreadOperation)
func make(_ childOperation: MainThreadOperation, dependOn parentOperation: MainThreadOperation)

View File

@@ -8,7 +8,7 @@
import Foundation
public protocol UndoableCommand: class {
public protocol UndoableCommand: AnyObject {
var undoActionName: String { get }
var redoActionName: String { get }
@@ -39,7 +39,7 @@ extension UndoableCommand {
// Useful for view controllers.
public protocol UndoableCommandRunner: class {
public protocol UndoableCommandRunner: AnyObject {
var undoableCommands: [UndoableCommand] { get set }
var undoManager: UndoManager? { get }