mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Remove unused delegates.
This commit is contained in:
@@ -140,8 +140,6 @@ import Sparkle
|
||||
installAppleEventHandlers()
|
||||
|
||||
CacheCleaner.purgeIfNecessary()
|
||||
|
||||
initializeDownloaders()
|
||||
}
|
||||
|
||||
func applicationDidFinishLaunching(_ note: Notification) {
|
||||
|
||||
@@ -18,11 +18,6 @@ public extension Notification.Name {
|
||||
static let FaviconDidBecomeAvailable = Notification.Name("FaviconDidBecomeAvailableNotification") // userInfo key: FaviconDownloader.UserInfoKey.faviconURL
|
||||
}
|
||||
|
||||
public protocol FaviconDownloaderDelegate {
|
||||
|
||||
@MainActor var appIconImage: IconImage? { get }
|
||||
}
|
||||
|
||||
@MainActor public final class FaviconDownloader {
|
||||
|
||||
public static let shared = FaviconDownloader()
|
||||
@@ -56,8 +51,6 @@ public protocol FaviconDownloaderDelegate {
|
||||
private let queue: DispatchQueue
|
||||
private var cache = [Feed: IconImage]() // faviconURL: RSImage
|
||||
|
||||
public var delegate: FaviconDownloaderDelegate?
|
||||
|
||||
struct UserInfoKey {
|
||||
static let faviconURL = "faviconURL"
|
||||
}
|
||||
@@ -132,7 +125,7 @@ public protocol FaviconDownloaderDelegate {
|
||||
|
||||
if let url = URL(string: homePageURL) {
|
||||
if url.host == "nnw.ranchero.com" || url.host == "netnewswire.blog" {
|
||||
return delegate?.appIconImage
|
||||
return IconImage.appIcon
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,6 @@ public extension Notification.Name {
|
||||
static let FeedIconDidBecomeAvailable = Notification.Name("FeedIconDidBecomeAvailableNotification") // UserInfoKey.feed
|
||||
}
|
||||
|
||||
public protocol FeedIconDownloaderDelegate: Sendable {
|
||||
|
||||
@MainActor var appIconImage: IconImage? { get }
|
||||
}
|
||||
|
||||
@MainActor public final class FeedIconDownloader {
|
||||
|
||||
public static let shared = FeedIconDownloader()
|
||||
@@ -64,8 +59,6 @@ public protocol FeedIconDownloaderDelegate: Sendable {
|
||||
private var urlsInProgress = Set<String>()
|
||||
private var cache = [Feed: IconImage]()
|
||||
private var waitingForFeedURLs = [String: Feed]()
|
||||
|
||||
public var delegate: FeedIconDownloaderDelegate?
|
||||
|
||||
public init() {
|
||||
|
||||
@@ -91,7 +84,7 @@ public protocol FeedIconDownloaderDelegate: Sendable {
|
||||
}
|
||||
|
||||
if let hpURLString = feed.homePageURL, let hpURL = URL(string: hpURLString), (hpURL.host == "nnw.ranchero.com" || hpURL.host == "netnewswire.blog") {
|
||||
return delegate?.appIconImage
|
||||
return IconImage.appIcon
|
||||
}
|
||||
|
||||
@MainActor func checkHomePageURL() {
|
||||
|
||||
@@ -8,7 +8,11 @@
|
||||
|
||||
import Foundation
|
||||
import Core
|
||||
import Images
|
||||
#if os(macOS)
|
||||
import AppKit
|
||||
#elseif os(iOS)
|
||||
import UIKit
|
||||
#endif
|
||||
|
||||
extension RSImage {
|
||||
static let appIconImage: RSImage? = {
|
||||
|
||||
@@ -11,17 +11,7 @@ import Images
|
||||
import Account
|
||||
import Parser
|
||||
|
||||
extension AppDelegate: FaviconDownloaderDelegate, FeedIconDownloaderDelegate {
|
||||
|
||||
var appIconImage: IconImage? {
|
||||
IconImage.appIcon
|
||||
}
|
||||
|
||||
func initializeDownloaders() {
|
||||
|
||||
FaviconDownloader.shared.delegate = self
|
||||
FeedIconDownloader.shared.delegate = self
|
||||
}
|
||||
extension AppDelegate {
|
||||
|
||||
func handleUnreadCountDidChange() {
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationC
|
||||
|
||||
registerBackgroundTasks()
|
||||
CacheCleaner.purgeIfNecessary()
|
||||
initializeDownloaders()
|
||||
initializeHomeScreenQuickActions()
|
||||
|
||||
Task { @MainActor in
|
||||
@@ -128,10 +127,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationC
|
||||
SingleLineUILabelSizer.emptyCache()
|
||||
IconImageCache.shared.emptyCache()
|
||||
AccountManager.shared.emptyCaches()
|
||||
|
||||
Task.detached {
|
||||
await DownloadWithCacheManager.shared.cleanupCache()
|
||||
}
|
||||
DownloadWithCacheManager.shared.cleanupCache()
|
||||
}
|
||||
|
||||
// MARK: Notifications
|
||||
|
||||
Reference in New Issue
Block a user