diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 3d832baba..18ed8a697 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -9,7 +9,7 @@ import AppKit import UserNotifications import Articles -import RSTree +import Tree import RSWeb import Account import CoreResources diff --git a/Mac/MainWindow/AddFeed/AddFeedController.swift b/Mac/MainWindow/AddFeed/AddFeedController.swift index 45d5eb42b..c1362a9a2 100644 --- a/Mac/MainWindow/AddFeed/AddFeedController.swift +++ b/Mac/MainWindow/AddFeed/AddFeedController.swift @@ -8,7 +8,7 @@ import AppKit import CoreResources -import RSTree +import Tree import Articles import Account import RSParser diff --git a/Mac/MainWindow/AddFeed/AddFeedWindowController.swift b/Mac/MainWindow/AddFeed/AddFeedWindowController.swift index 49d5726ef..25d3b4c9f 100644 --- a/Mac/MainWindow/AddFeed/AddFeedWindowController.swift +++ b/Mac/MainWindow/AddFeed/AddFeedWindowController.swift @@ -7,7 +7,7 @@ // import AppKit -import RSTree +import Tree import Articles import Account diff --git a/Mac/MainWindow/AddFeed/FolderTreeMenu.swift b/Mac/MainWindow/AddFeed/FolderTreeMenu.swift index 340418716..6130ad352 100644 --- a/Mac/MainWindow/AddFeed/FolderTreeMenu.swift +++ b/Mac/MainWindow/AddFeed/FolderTreeMenu.swift @@ -7,7 +7,7 @@ // import AppKit -import RSTree +import Tree import Account import Core diff --git a/Mac/MainWindow/Sidebar/Cell/SidebarCell.swift b/Mac/MainWindow/Sidebar/Cell/SidebarCell.swift index 4453a247d..5c28e3979 100644 --- a/Mac/MainWindow/Sidebar/Cell/SidebarCell.swift +++ b/Mac/MainWindow/Sidebar/Cell/SidebarCell.swift @@ -8,7 +8,7 @@ import Foundation import Account -import RSTree +import Tree class SidebarCell : NSTableCellView { diff --git a/Mac/MainWindow/Sidebar/SidebarDeleteItemsAlert.swift b/Mac/MainWindow/Sidebar/SidebarDeleteItemsAlert.swift index 59b20430a..0d9ff2885 100644 --- a/Mac/MainWindow/Sidebar/SidebarDeleteItemsAlert.swift +++ b/Mac/MainWindow/Sidebar/SidebarDeleteItemsAlert.swift @@ -7,7 +7,7 @@ // import AppKit -import RSTree +import Tree import Account @MainActor struct SidebarDeleteItemsAlert { diff --git a/Mac/MainWindow/Sidebar/SidebarOutlineDataSource.swift b/Mac/MainWindow/Sidebar/SidebarOutlineDataSource.swift index da819a1f5..06825d065 100644 --- a/Mac/MainWindow/Sidebar/SidebarOutlineDataSource.swift +++ b/Mac/MainWindow/Sidebar/SidebarOutlineDataSource.swift @@ -7,7 +7,7 @@ // import AppKit -import RSTree +import Tree import Articles import Account import Core diff --git a/Mac/MainWindow/Sidebar/SidebarOutlineView.swift b/Mac/MainWindow/Sidebar/SidebarOutlineView.swift index 45a1bb404..64b951e36 100644 --- a/Mac/MainWindow/Sidebar/SidebarOutlineView.swift +++ b/Mac/MainWindow/Sidebar/SidebarOutlineView.swift @@ -7,7 +7,7 @@ // import AppKit -import RSTree +import Tree import AppKitExtras class SidebarOutlineView : NSOutlineView { diff --git a/Mac/MainWindow/Sidebar/SidebarViewController.swift b/Mac/MainWindow/Sidebar/SidebarViewController.swift index c879ef851..1125619cf 100644 --- a/Mac/MainWindow/Sidebar/SidebarViewController.swift +++ b/Mac/MainWindow/Sidebar/SidebarViewController.swift @@ -7,7 +7,7 @@ // import AppKit -import RSTree +import Tree import Articles import Account import Core diff --git a/Shared/Commands/DeleteCommand.swift b/Shared/Commands/DeleteCommand.swift index 9b0dbede0..4119de2f1 100644 --- a/Shared/Commands/DeleteCommand.swift +++ b/Shared/Commands/DeleteCommand.swift @@ -7,12 +7,12 @@ // import Foundation -import RSTree +import Tree import Account import Articles import Core -final class DeleteCommand: UndoableCommand { +@MainActor final class DeleteCommand: UndoableCommand { let treeController: TreeController? let undoManager: UndoManager @@ -67,7 +67,7 @@ final class DeleteCommand: UndoableCommand { registerRedo() } - static func canDelete(_ nodes: [Node]) -> Bool { + @MainActor static func canDelete(_ nodes: [Node]) -> Bool { // Return true if all nodes are feeds and folders. // Any other type: return false. @@ -93,7 +93,7 @@ final class DeleteCommand: UndoableCommand { // Remember as much as we can now about the items being deleted, // so they can be restored to the correct place. -private struct SidebarItemSpecifier { +@MainActor private struct SidebarItemSpecifier { private weak var account: Account? private let parentFolder: Folder? @@ -265,7 +265,7 @@ private struct DeleteActionName { private static let deleteFolders = NSLocalizedString("Delete Folders", comment: "command") private static let deleteFeedsAndFolders = NSLocalizedString("Delete Feeds and Folders", comment: "command") - static func name(for nodes: [Node]) -> String? { + @MainActor static func name(for nodes: [Node]) -> String? { var numberOfFeeds = 0 var numberOfFolders = 0 diff --git a/Shared/Extensions/Node-Extensions.swift b/Shared/Extensions/Node-Extensions.swift index fa44efabf..ade0ac9aa 100644 --- a/Shared/Extensions/Node-Extensions.swift +++ b/Shared/Extensions/Node-Extensions.swift @@ -7,18 +7,18 @@ // import Foundation -import RSTree +import Tree import Articles import Core extension Array where Element == Node { - func sortedAlphabetically() -> [Node] { + @MainActor func sortedAlphabetically() -> [Node] { return Node.nodesSortedAlphabetically(self) } - func sortedAlphabeticallyWithFoldersAtEnd() -> [Node] { + @MainActor func sortedAlphabeticallyWithFoldersAtEnd() -> [Node] { return Node.nodesSortedAlphabeticallyWithFoldersAtEnd(self) } diff --git a/Shared/Tree/FeedTreeControllerDelegate.swift b/Shared/Tree/FeedTreeControllerDelegate.swift index 299929814..fd7e3ccda 100644 --- a/Shared/Tree/FeedTreeControllerDelegate.swift +++ b/Shared/Tree/FeedTreeControllerDelegate.swift @@ -7,11 +7,11 @@ // import Foundation -import RSTree +import Tree import Articles import Account -final class FeedTreeControllerDelegate: TreeControllerDelegate { +@MainActor final class FeedTreeControllerDelegate: TreeControllerDelegate { private var filterExceptions = Set() var isReadFiltered = false @@ -54,14 +54,14 @@ private extension FeedTreeControllerDelegate { return topLevelNodes } - func childNodesForSmartFeeds(_ parentNode: Node) -> [Node] { + @MainActor func childNodesForSmartFeeds(_ parentNode: Node) -> [Node] { return SmartFeedsController.shared.smartFeeds.compactMap { (feed) -> Node? in // All Smart Feeds should remain visible despite the Hide Read Feeds setting return parentNode.existingOrNewChildNode(with: feed as AnyObject) } } - func childNodesForContainerNode(_ containerNode: Node) -> [Node]? { + @MainActor func childNodesForContainerNode(_ containerNode: Node) -> [Node]? { let container = containerNode.representedObject as! Container var children = [AnyObject]() diff --git a/Shared/Tree/FolderTreeControllerDelegate.swift b/Shared/Tree/FolderTreeControllerDelegate.swift index be06ca83d..782d39ece 100644 --- a/Shared/Tree/FolderTreeControllerDelegate.swift +++ b/Shared/Tree/FolderTreeControllerDelegate.swift @@ -7,12 +7,12 @@ // import Foundation -import RSTree +import Tree import Articles import Account -final class FolderTreeControllerDelegate: TreeControllerDelegate { - +@MainActor final class FolderTreeControllerDelegate: TreeControllerDelegate { + @MainActor func treeController(treeController: TreeController, childNodesFor node: Node) -> [Node]? { return node.isRoot ? childNodesForRootNode(node) : childNodes(node) @@ -21,15 +21,15 @@ final class FolderTreeControllerDelegate: TreeControllerDelegate { private extension FolderTreeControllerDelegate { - @MainActor func childNodesForRootNode(_ node: Node) -> [Node]? { + func childNodesForRootNode(_ node: Node) -> [Node]? { let accountNodes: [Node] = AccountManager.shared.sortedActiveAccounts.map { account in let accountNode = Node(representedObject: account, parent: node) accountNode.canHaveChildNodes = true return accountNode } + return accountNodes - } func childNodes(_ node: Node) -> [Node]? { @@ -40,7 +40,6 @@ private extension FolderTreeControllerDelegate { let folderNodes: [Node] = folders.map { createNode($0, parent: node) } return folderNodes.sortedAlphabetically() - } func createNode(_ folder: Folder, parent: Node) -> Node { @@ -48,5 +47,4 @@ private extension FolderTreeControllerDelegate { node.canHaveChildNodes = false return node } - } diff --git a/Tree/Sources/Tree/TreeController.swift b/Tree/Sources/Tree/TreeController.swift index 1d976cebb..f124c8ebd 100644 --- a/Tree/Sources/Tree/TreeController.swift +++ b/Tree/Sources/Tree/TreeController.swift @@ -10,7 +10,7 @@ import Foundation public protocol TreeControllerDelegate: AnyObject { - func treeController(treeController: TreeController, childNodesFor: Node) -> [Node]? + @MainActor func treeController(treeController: TreeController, childNodesFor: Node) -> [Node]? } public typealias NodeVisitBlock = (_ : Node) -> Void diff --git a/iOS/Add/AddFeedViewController.swift b/iOS/Add/AddFeedViewController.swift index 0d468dd45..2ff8ece0a 100644 --- a/iOS/Add/AddFeedViewController.swift +++ b/iOS/Add/AddFeedViewController.swift @@ -8,7 +8,7 @@ import UIKit import Account -import RSTree +import Tree import RSParser import Core diff --git a/iOS/Feeds/Cell/FeedTableViewCell.swift b/iOS/Feeds/Cell/FeedTableViewCell.swift index 9c647faf4..960585381 100644 --- a/iOS/Feeds/Cell/FeedTableViewCell.swift +++ b/iOS/Feeds/Cell/FeedTableViewCell.swift @@ -8,7 +8,7 @@ import UIKit import Account -import RSTree +import Tree protocol FeedTableViewCellDelegate: AnyObject { func feedTableViewCellDisclosureDidToggle(_ sender: FeedTableViewCell, expanding: Bool) diff --git a/iOS/Feeds/FeedsViewController+Drop.swift b/iOS/Feeds/FeedsViewController+Drop.swift index f5312ed2c..adfdca028 100644 --- a/iOS/Feeds/FeedsViewController+Drop.swift +++ b/iOS/Feeds/FeedsViewController+Drop.swift @@ -8,7 +8,7 @@ import UIKit import Account -import RSTree +import Tree import Core extension SidebarViewController: UITableViewDropDelegate { diff --git a/iOS/Feeds/SidebarViewController.swift b/iOS/Feeds/SidebarViewController.swift index 2a05ea521..6d8a24889 100644 --- a/iOS/Feeds/SidebarViewController.swift +++ b/iOS/Feeds/SidebarViewController.swift @@ -9,7 +9,7 @@ import UIKit import Account import Articles -import RSTree +import Tree import SafariServices import Core diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 1ec79a024..6f3d20a4e 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -10,7 +10,7 @@ import UIKit import UserNotifications import Account import Articles -import RSTree +import Tree import SafariServices import SwiftUI import Core diff --git a/iOS/ShareExtension/ShareViewController.swift b/iOS/ShareExtension/ShareViewController.swift index cabd6d5ee..588fece1d 100644 --- a/iOS/ShareExtension/ShareViewController.swift +++ b/iOS/ShareExtension/ShareViewController.swift @@ -10,7 +10,7 @@ import UIKit import MobileCoreServices import Account import Social -import RSTree +import Tree import UniformTypeIdentifiers class ShareViewController: SLComposeServiceViewController, ShareFolderPickerControllerDelegate {