mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 01:40:22 +00:00
Use an image for feeds that don’t have favicons. Currently using the image at /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns — but this might change.
This commit is contained in:
1 parent
ab80e91ea7
commit
953a97afd7
3 files changed
+14
-2
No files matched your search
@@ -27,6 +27,12 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
||||
var feedIconDownloader: FeedIconDownloader!
|
||||
var appName: String!
|
||||
|
||||
lazy var genericFeedImage: NSImage? = {
|
||||
let path = "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns"
|
||||
let image = NSImage(contentsOfFile: path)
|
||||
return image
|
||||
}()
|
||||
|
||||
var unreadCount = 0 {
|
||||
didSet {
|
||||
if unreadCount != oldValue {
|
||||
|
||||
@@ -111,7 +111,10 @@ extension FeedListViewController: NSOutlineViewDelegate {
|
||||
return NSImage(named: NSImage.Name.folder)
|
||||
}
|
||||
else if let feed = node.representedObject as? FeedListFeed {
|
||||
return appDelegate.faviconDownloader.favicon(withHomePageURL: feed.homePageURL)
|
||||
if let image = appDelegate.faviconDownloader.favicon(withHomePageURL: feed.homePageURL) {
|
||||
return image
|
||||
}
|
||||
return appDelegate.genericFeedImage
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -522,7 +522,10 @@ private extension SidebarViewController {
|
||||
extension Feed: SmallIconProvider {
|
||||
|
||||
var smallIcon: NSImage? {
|
||||
return appDelegate.faviconDownloader.favicon(for: self)
|
||||
if let image = appDelegate.faviconDownloader.favicon(for: self) {
|
||||
return image
|
||||
}
|
||||
return appDelegate.genericFeedImage
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user