Make minor cleanups.

This commit is contained in:
Brent Simmons 2017-09-23 13:59:19 -07:00
parent d3593683df
commit 8c0c8db824
4 changed files with 4 additions and 8 deletions

View File

@ -20,13 +20,10 @@ final class AppDefaults {
static let shared = AppDefaults()
private struct Key {
static let firstRunDate = "firstRunDate"
static let sidebarFontSize = "sidebarFontSize"
static let timelineFontSize = "timelineFontSize"
static let detailFontSize = "detailFontSize"
static let openInBrowserInBackground = "openInBrowserInBackground"
}

View File

@ -21,9 +21,9 @@ private let nnwStyleSuffix = ".nnwstyle"
private let cssStyleSuffix = ".css"
private let styleSuffixes = [styleSuffix, nnwStyleSuffix, cssStyleSuffix];
public final class ArticleStylesManager {
final class ArticleStylesManager {
static let sharedInstance = ArticleStylesManager()
static let shared = ArticleStylesManager()
private let folderPath = RSDataSubfolder(nil, stylesFolderName)!
var currentStyleName: String {

View File

@ -14,8 +14,7 @@ import RSWeb
func openInBrowser(_ urlString: String) {
// Opens according to prefs.
let openInBackground = UserDefaults.standard.bool(forKey: OpenInBrowserInBackgroundKey)
openInBrowser(urlString, inBackground: openInBackground)
openInBrowser(urlString, inBackground: AppDefaults.shared.openInBrowserInBackground)
}
func openInBrowser(_ urlString: String, inBackground: Bool) {

View File

@ -72,7 +72,7 @@ class DetailViewController: NSViewController, WKNavigationDelegate, WKUIDelegate
private func reloadHTML() {
if let article = article {
let articleRenderer = ArticleRenderer(article: article, style: ArticleStylesManager.sharedInstance.currentStyle)
let articleRenderer = ArticleRenderer(article: article, style: ArticleStylesManager.shared.currentStyle)
webview.loadHTMLString(articleRenderer.html, baseURL: articleRenderer.baseURL)
}
else {