diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 5a37f81a4..7cd64eb4d 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -41,7 +41,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, var faviconDownloader: FaviconDownloader! var imageDownloader: ImageDownloader! var authorAvatarDownloader: AuthorAvatarDownloader! - var webFeedIconDownloader: WebFeedIconDownloader! + var feedIconDownloader: FeedIconDownloader! var extensionContainersFile: ExtensionContainersFile! var extensionFeedAddRequestFile: ExtensionFeedAddRequestFile! @@ -145,9 +145,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, addFolderWindowController!.runSheetOnWindow(window) } - @MainActor func showAddWebFeedSheetOnWindow(_ window: NSWindow, urlString: String?, name: String?, account: Account?, folder: Folder?) { + @MainActor func showAddFeedSheetOnWindow(_ window: NSWindow, urlString: String?, name: String?, account: Account?, folder: Folder?) { addFeedController = AddFeedController(hostWindow: window) - addFeedController?.showAddFeedSheet(.webFeed, urlString, name, account, folder) + addFeedController?.showAddFeedSheet(.feed, urlString, name, account, folder) } // MARK: - NSApplicationDelegate @@ -178,7 +178,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, imageDownloader = ImageDownloader(folder: imagesFolder) authorAvatarDownloader = AuthorAvatarDownloader(imageDownloader: imageDownloader) - webFeedIconDownloader = WebFeedIconDownloader(imageDownloader: imageDownloader, folder: cacheFolder) + feedIconDownloader = FeedIconDownloader(imageDownloader: imageDownloader, folder: cacheFolder) appName = (Bundle.main.infoDictionary!["CFBundleExecutable"]! as! String) } @@ -230,7 +230,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, mainWindowController?.window?.center() } - NotificationCenter.default.addObserver(self, selector: #selector(webFeedSettingDidChange(_:)), name: .FeedSettingDidChange, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(feedSettingDidChange(_:)), name: .FeedSettingDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil) DispatchQueue.main.async { @@ -402,7 +402,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, } } - @MainActor @objc func webFeedSettingDidChange(_ note: Notification) { + @MainActor @objc func feedSettingDidChange(_ note: Notification) { guard let feed = note.object as? Feed, let key = note.userInfo?[Feed.FeedSettingUserInfoKey] as? String else { return } @@ -556,7 +556,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, return } - showAddWebFeedSheetOnWindow(mainWindowController!.window!, urlString: urlString, name: name, account: account, folder: folder) + showAddFeedSheetOnWindow(mainWindowController!.window!, urlString: urlString, name: name, account: account, folder: folder) } // MARK: - Dock Badge diff --git a/Mac/MainWindow/AddFeed/AddFeedController.swift b/Mac/MainWindow/AddFeed/AddFeedController.swift index e7f54e216..2ad9473c3 100644 --- a/Mac/MainWindow/AddFeed/AddFeedController.swift +++ b/Mac/MainWindow/AddFeed/AddFeedController.swift @@ -38,7 +38,7 @@ import RSParser let folderTreeController = TreeController(delegate: folderTreeControllerDelegate) switch type { - case .webFeed: + case .feed: addFeedWindowController = AddWebFeedWindowController(urlString: urlString ?? urlStringFromPasteboard, name: name, account: account, diff --git a/Mac/MainWindow/AddFeed/AddFeedWIndowController.swift b/Mac/MainWindow/AddFeed/AddFeedWIndowController.swift index 1935cbc0d..74f217c4d 100644 --- a/Mac/MainWindow/AddFeed/AddFeedWIndowController.swift +++ b/Mac/MainWindow/AddFeed/AddFeedWIndowController.swift @@ -10,7 +10,7 @@ import Foundation import Account enum AddFeedWindowControllerType { - case webFeed + case feed } @MainActor protocol AddFeedWindowControllerDelegate: AnyObject { diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index a7e26993a..e38bbe157 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -304,7 +304,7 @@ 51C4529D22650A1000C03939 /* FaviconURLFinder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84FF69B01FC3793300DC198E /* FaviconURLFinder.swift */; }; 51C4529E22650A1900C03939 /* ImageDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845213221FCA5B10003B6E93 /* ImageDownloader.swift */; }; 51C4529F22650A1900C03939 /* AuthorAvatarDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E850851FCB60CE0072EA88 /* AuthorAvatarDownloader.swift */; }; - 51C452A022650A1900C03939 /* WebFeedIconDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842611891FCB67AA0086A189 /* WebFeedIconDownloader.swift */; }; + 51C452A022650A1900C03939 /* FeedIconDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842611891FCB67AA0086A189 /* FeedIconDownloader.swift */; }; 51C452A222650A1900C03939 /* RSHTMLMetadata+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842611A11FCB769D0086A189 /* RSHTMLMetadata+Extension.swift */; }; 51C452A322650A1E00C03939 /* HTMLMetadataDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8426119D1FCB6ED40086A189 /* HTMLMetadataDownloader.swift */; }; 51C452A422650A2D00C03939 /* ArticleUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97581ED9EB0D007D329B /* ArticleUtilities.swift */; }; @@ -460,7 +460,7 @@ 65ED3FDC235DEF6C0081F399 /* UnreadCountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97631ED9EB96007D329B /* UnreadCountView.swift */; }; 65ED3FDD235DEF6C0081F399 /* ActivityType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51D87EE02311D34700E63F03 /* ActivityType.swift */; }; 65ED3FDE235DEF6C0081F399 /* CrashReportWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840BEE4021D70E64009BBAFA /* CrashReportWindowController.swift */; }; - 65ED3FDF235DEF6C0081F399 /* WebFeedIconDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842611891FCB67AA0086A189 /* WebFeedIconDownloader.swift */; }; + 65ED3FDF235DEF6C0081F399 /* FeedIconDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842611891FCB67AA0086A189 /* FeedIconDownloader.swift */; }; 65ED3FE0235DEF6C0081F399 /* PreferencesControlsBackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C9FC7122629E1200D921D6 /* PreferencesControlsBackgroundView.swift */; }; 65ED3FE1235DEF6C0081F399 /* MarkCommandValidationStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84162A142038C12C00035290 /* MarkCommandValidationStatus.swift */; }; 65ED3FE2235DEF6C0081F399 /* ArticlePasteboardWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E95D231FB1087500552D99 /* ArticlePasteboardWriter.swift */; }; @@ -599,7 +599,7 @@ 841ABA5E20145E9200980E11 /* FolderInspectorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841ABA5D20145E9200980E11 /* FolderInspectorViewController.swift */; }; 841ABA6020145EC100980E11 /* BuiltinSmartFeedInspectorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841ABA5F20145EC100980E11 /* BuiltinSmartFeedInspectorViewController.swift */; }; 84216D0322128B9D0049B9B9 /* DetailWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84216D0222128B9D0049B9B9 /* DetailWebViewController.swift */; }; - 8426118A1FCB67AA0086A189 /* WebFeedIconDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842611891FCB67AA0086A189 /* WebFeedIconDownloader.swift */; }; + 8426118A1FCB67AA0086A189 /* FeedIconDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842611891FCB67AA0086A189 /* FeedIconDownloader.swift */; }; 8426119E1FCB6ED40086A189 /* HTMLMetadataDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8426119D1FCB6ED40086A189 /* HTMLMetadataDownloader.swift */; }; 842611A21FCB769D0086A189 /* RSHTMLMetadata+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842611A11FCB769D0086A189 /* RSHTMLMetadata+Extension.swift */; }; 842E45CE1ED8C308000A8B52 /* AppNotifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842E45CD1ED8C308000A8B52 /* AppNotifications.swift */; }; @@ -1348,7 +1348,7 @@ 841ABA5D20145E9200980E11 /* FolderInspectorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FolderInspectorViewController.swift; sourceTree = ""; }; 841ABA5F20145EC100980E11 /* BuiltinSmartFeedInspectorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuiltinSmartFeedInspectorViewController.swift; sourceTree = ""; }; 84216D0222128B9D0049B9B9 /* DetailWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailWebViewController.swift; sourceTree = ""; }; - 842611891FCB67AA0086A189 /* WebFeedIconDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebFeedIconDownloader.swift; sourceTree = ""; }; + 842611891FCB67AA0086A189 /* FeedIconDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedIconDownloader.swift; sourceTree = ""; }; 8426119D1FCB6ED40086A189 /* HTMLMetadataDownloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTMLMetadataDownloader.swift; sourceTree = ""; }; 8426119F1FCB72600086A189 /* FeaturedImageDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturedImageDownloader.swift; sourceTree = ""; }; 842611A11FCB769D0086A189 /* RSHTMLMetadata+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RSHTMLMetadata+Extension.swift"; sourceTree = ""; }; @@ -2316,7 +2316,7 @@ children = ( 845213221FCA5B10003B6E93 /* ImageDownloader.swift */, 84E850851FCB60CE0072EA88 /* AuthorAvatarDownloader.swift */, - 842611891FCB67AA0086A189 /* WebFeedIconDownloader.swift */, + 842611891FCB67AA0086A189 /* FeedIconDownloader.swift */, 8426119F1FCB72600086A189 /* FeaturedImageDownloader.swift */, 842611A11FCB769D0086A189 /* RSHTMLMetadata+Extension.swift */, ); @@ -3949,7 +3949,7 @@ 65ED3FDC235DEF6C0081F399 /* UnreadCountView.swift in Sources */, 65ED3FDD235DEF6C0081F399 /* ActivityType.swift in Sources */, 65ED3FDE235DEF6C0081F399 /* CrashReportWindowController.swift in Sources */, - 65ED3FDF235DEF6C0081F399 /* WebFeedIconDownloader.swift in Sources */, + 65ED3FDF235DEF6C0081F399 /* FeedIconDownloader.swift in Sources */, B24E9ADD245AB88400DA5718 /* NSAttributedString+NetNewsWire.swift in Sources */, 510C417C24E5D1AE008226FD /* ExtensionFeedAddRequestFile.swift in Sources */, 510C417D24E5D1AE008226FD /* ExtensionContainers.swift in Sources */, @@ -4160,7 +4160,7 @@ 5F323809231DF9F000706F6B /* VibrantTableViewCell.swift in Sources */, 51FE10042345529D0056195D /* UserNotificationManager.swift in Sources */, 51C4CFF224D37D1F00AF9874 /* Secrets.swift in Sources */, - 51C452A022650A1900C03939 /* WebFeedIconDownloader.swift in Sources */, + 51C452A022650A1900C03939 /* FeedIconDownloader.swift in Sources */, 51C4529E22650A1900C03939 /* ImageDownloader.swift in Sources */, 51A66685238075AE00CB272D /* AddWebFeedDefaultContainer.swift in Sources */, 176813E92564BAE200D98635 /* WidgetDeepLinks.swift in Sources */, @@ -4312,7 +4312,7 @@ 510C418024E5D1AE008226FD /* ExtensionFeedAddRequestFile.swift in Sources */, 51FE10092346739D0056195D /* ActivityType.swift in Sources */, 840BEE4121D70E64009BBAFA /* CrashReportWindowController.swift in Sources */, - 8426118A1FCB67AA0086A189 /* WebFeedIconDownloader.swift in Sources */, + 8426118A1FCB67AA0086A189 /* FeedIconDownloader.swift in Sources */, 84C9FC7B22629E1200D921D6 /* PreferencesControlsBackgroundView.swift in Sources */, 84162A152038C12C00035290 /* MarkCommandValidationStatus.swift in Sources */, 17D643B126F8A436008D4C05 /* ArticleThemeDownloader.swift in Sources */, diff --git a/Shared/IconImageCache.swift b/Shared/IconImageCache.swift index fe4a67ded..f69dafbdc 100644 --- a/Shared/IconImageCache.swift +++ b/Shared/IconImageCache.swift @@ -84,7 +84,7 @@ private extension IconImageCache { if let iconImage = webFeedIconImageCache[itemID] { return iconImage } - if let iconImage = appDelegate.webFeedIconDownloader.icon(for: webFeed) { + if let iconImage = appDelegate.feedIconDownloader.icon(for: webFeed) { webFeedIconImageCache[itemID] = iconImage return iconImage } diff --git a/Shared/Images/WebFeedIconDownloader.swift b/Shared/Images/FeedIconDownloader.swift similarity index 95% rename from Shared/Images/WebFeedIconDownloader.swift rename to Shared/Images/FeedIconDownloader.swift index 22675816c..653fc918d 100644 --- a/Shared/Images/WebFeedIconDownloader.swift +++ b/Shared/Images/FeedIconDownloader.swift @@ -18,7 +18,7 @@ extension Notification.Name { static let WebFeedIconDidBecomeAvailable = Notification.Name("WebFeedIconDidBecomeAvailableNotification") // UserInfoKey.feed } -public final class WebFeedIconDownloader { +public final class FeedIconDownloader { private static let saveQueue = CoalescingQueue(name: "Cache Save Queue", interval: 1.0) @@ -151,7 +151,7 @@ public final class WebFeedIconDownloader { } -private extension WebFeedIconDownloader { +private extension FeedIconDownloader { func icon(forHomePageURL homePageURL: String, feed: Feed, _ imageResultBlock: @escaping (RSImage?) -> Void) { @@ -256,15 +256,15 @@ private extension WebFeedIconDownloader { } func queueSaveFeedURLToIconURLCacheIfNeeded() { - WebFeedIconDownloader.saveQueue.add(self, #selector(saveFeedURLToIconURLCacheIfNeeded)) + FeedIconDownloader.saveQueue.add(self, #selector(saveFeedURLToIconURLCacheIfNeeded)) } func queueSaveHomePageToIconURLCacheIfNeeded() { - WebFeedIconDownloader.saveQueue.add(self, #selector(saveHomePageToIconURLCacheIfNeeded)) + FeedIconDownloader.saveQueue.add(self, #selector(saveHomePageToIconURLCacheIfNeeded)) } func queueHomePagesWithNoIconURLCacheIfNeeded() { - WebFeedIconDownloader.saveQueue.add(self, #selector(saveHomePagesWithNoIconURLCacheIfNeeded)) + FeedIconDownloader.saveQueue.add(self, #selector(saveHomePagesWithNoIconURLCacheIfNeeded)) } func saveFeedURLToIconURLCache() { diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index da6cccc5c..ea511626d 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -40,7 +40,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD var faviconDownloader: FaviconDownloader! var imageDownloader: ImageDownloader! var authorAvatarDownloader: AuthorAvatarDownloader! - var webFeedIconDownloader: WebFeedIconDownloader! + var feedIconDownloader: FeedIconDownloader! var extensionContainersFile: ExtensionContainersFile! var extensionFeedAddRequestFile: ExtensionFeedAddRequestFile! var widgetDataEncoder: WidgetDataEncoder! @@ -250,7 +250,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD let tempFolder = tempDir.absoluteString let tempFolderPath = tempFolder.suffix(from: tempFolder.index(tempFolder.startIndex, offsetBy: 7)) - webFeedIconDownloader = WebFeedIconDownloader(imageDownloader: imageDownloader, folder: String(tempFolderPath)) + feedIconDownloader = FeedIconDownloader(imageDownloader: imageDownloader, folder: String(tempFolderPath)) } private func initializeHomeScreenQuickActions() {