mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Delete some unused files.
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// MasterFeedTableViewCellSectionIdentifier.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 6/3/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RSTree
|
||||
|
||||
struct MasterFeedTableViewSectionIdentifier: Hashable {
|
||||
|
||||
init(node: Node) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// MasterFeedTableViewIdentifier.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 6/3/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Account
|
||||
import RSTree
|
||||
|
||||
final class MasterFeedTableViewIdentifier: NSObject, NSCopying {
|
||||
|
||||
let feedID: FeedIdentifier?
|
||||
let containerID: ContainerIdentifier?
|
||||
let parentContainerID: ContainerIdentifier?
|
||||
|
||||
let isEditable: Bool
|
||||
let isPsuedoFeed: Bool
|
||||
let isFolder: Bool
|
||||
let isWebFeed: Bool
|
||||
|
||||
let nameForDisplay: String
|
||||
let url: String?
|
||||
let unreadCount: Int
|
||||
let childCount: Int
|
||||
|
||||
var account: Account? {
|
||||
if isFolder, let parentContainerID = parentContainerID {
|
||||
return AccountManager.shared.existingContainer(with: parentContainerID) as? Account
|
||||
}
|
||||
if isWebFeed, let feedID = feedID {
|
||||
return (AccountManager.shared.existingFeed(with: feedID) as? WebFeed)?.account
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
init(node: Node, unreadCount: Int) {
|
||||
let feed = node.representedObject as! Feed
|
||||
self.feedID = feed.feedID
|
||||
self.containerID = (node.representedObject as? Container)?.containerID
|
||||
self.parentContainerID = (node.parent?.representedObject as? Container)?.containerID
|
||||
|
||||
self.isEditable = !(node.representedObject is PseudoFeed)
|
||||
self.isPsuedoFeed = node.representedObject is PseudoFeed
|
||||
self.isFolder = node.representedObject is Folder
|
||||
self.isWebFeed = node.representedObject is WebFeed
|
||||
self.nameForDisplay = feed.nameForDisplay
|
||||
|
||||
if let webFeed = node.representedObject as? WebFeed {
|
||||
self.url = webFeed.url
|
||||
} else {
|
||||
self.url = nil
|
||||
}
|
||||
|
||||
self.unreadCount = unreadCount
|
||||
self.childCount = node.numberOfChildNodes
|
||||
}
|
||||
|
||||
override func isEqual(_ object: Any?) -> Bool {
|
||||
guard let otherIdentifier = object as? MasterFeedTableViewIdentifier else { return false }
|
||||
if self === otherIdentifier { return true }
|
||||
return feedID == otherIdentifier.feedID && parentContainerID == otherIdentifier.parentContainerID
|
||||
}
|
||||
|
||||
override var hash: Int {
|
||||
var hasher = Hasher()
|
||||
hasher.combine(feedID)
|
||||
hasher.combine(parentContainerID)
|
||||
return hasher.finalize()
|
||||
}
|
||||
|
||||
func copy(with zone: NSZone? = nil) -> Any {
|
||||
return self
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
//
|
||||
// UpdateSelectionOperation.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 2/22/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import RSCore
|
||||
|
||||
class UpdateSelectionOperation: MainThreadOperation {
|
||||
|
||||
// MainThreadOperation
|
||||
public var isCanceled = false
|
||||
public var id: Int?
|
||||
public weak var operationDelegate: MainThreadOperationDelegate?
|
||||
public var name: String? = "UpdateSelectionOperation"
|
||||
public var completionBlock: MainThreadOperation.MainThreadOperationCompletionBlock?
|
||||
|
||||
private var coordinator: SceneCoordinator
|
||||
private var dataSource: MasterFeedDataSource
|
||||
private var tableView: UITableView
|
||||
private var animations: Animations
|
||||
|
||||
init(coordinator: SceneCoordinator, dataSource: MasterFeedDataSource, tableView: UITableView, animations: Animations) {
|
||||
self.coordinator = coordinator
|
||||
self.dataSource = dataSource
|
||||
self.tableView = tableView
|
||||
self.animations = animations
|
||||
}
|
||||
|
||||
func run() {
|
||||
if dataSource.snapshot().numberOfItems > 0 {
|
||||
if let indexPath = coordinator.currentFeedIndexPath {
|
||||
CATransaction.begin()
|
||||
CATransaction.setCompletionBlock {
|
||||
self.operationDelegate?.operationDidComplete(self)
|
||||
}
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animations: animations)
|
||||
CATransaction.commit()
|
||||
} else {
|
||||
if let indexPath = tableView.indexPathForSelectedRow {
|
||||
if animations.contains(.select) {
|
||||
CATransaction.begin()
|
||||
CATransaction.setCompletionBlock {
|
||||
self.operationDelegate?.operationDidComplete(self)
|
||||
}
|
||||
tableView.deselectRow(at: indexPath, animated: true)
|
||||
CATransaction.commit()
|
||||
} else {
|
||||
tableView.deselectRow(at: indexPath, animated: false)
|
||||
self.operationDelegate?.operationDidComplete(self)
|
||||
}
|
||||
} else {
|
||||
self.operationDelegate?.operationDidComplete(self)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.operationDelegate?.operationDidComplete(self)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user