mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Merge branch 'main' into ios-ui-settings-localised
# Conflicts: # NetNewsWire.xcodeproj/project.pbxproj # Shared/Timer/AccountRefreshTimer.swift # iOS/Account/ReaderAPIAccountViewController.swift
This commit is contained in:
@@ -20,7 +20,7 @@ struct ArticleTheme: Equatable {
|
||||
static let defaultTheme = ArticleTheme()
|
||||
static let nnwThemeSuffix = ".nnwtheme"
|
||||
|
||||
private static let defaultThemeName = NSLocalizedString("Default", comment: "Default")
|
||||
private static let defaultThemeName = "NetNewsWire"
|
||||
private static let unknownValue = NSLocalizedString("Unknown", comment: "Unknown Value")
|
||||
|
||||
let path: String?
|
||||
|
||||
@@ -77,6 +77,10 @@ public class ArticleThemeDownloader: Logging {
|
||||
private func findThemeFile(in searchPath: String) -> String? {
|
||||
if let directoryContents = FileManager.default.enumerator(atPath: searchPath) {
|
||||
while let file = directoryContents.nextObject() as? String {
|
||||
if file.hasPrefix("__MACOSX/") {
|
||||
logger.debug("Ignoring theme file in __MACOSX folder.")
|
||||
continue
|
||||
}
|
||||
if file.hasSuffix(".nnwtheme") {
|
||||
return file
|
||||
}
|
||||
|
||||
@@ -80,11 +80,13 @@ final class ArticleThemesManager: NSObject, NSFilePresenter, Logging, Observable
|
||||
}
|
||||
|
||||
func presentedSubitemDidChange(at url: URL) {
|
||||
themeNames = buildThemeNames()
|
||||
do {
|
||||
currentTheme = try articleThemeWithThemeName(currentThemeName)
|
||||
} catch {
|
||||
appDelegate.presentThemeImportError(error)
|
||||
if url.lastPathComponent.localizedCaseInsensitiveContains("nnwtheme") {
|
||||
themeNames = buildThemeNames()
|
||||
do {
|
||||
currentTheme = try articleThemeWithThemeName(currentThemeName)
|
||||
} catch {
|
||||
appDelegate.presentThemeImportError(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user