Remove not-going-to-get-used MAC_APP_STORE define.
This commit is contained in:
parent
f96ba4943c
commit
feb4bf3c48
@ -50,10 +50,8 @@ final class AppDefaults {
|
|||||||
static let feedDoubleClickMarkAsRead = "GruberFeedDoubleClickMarkAsRead"
|
static let feedDoubleClickMarkAsRead = "GruberFeedDoubleClickMarkAsRead"
|
||||||
static let suppressSyncOnLaunch = "DevroeSuppressSyncOnLaunch"
|
static let suppressSyncOnLaunch = "DevroeSuppressSyncOnLaunch"
|
||||||
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
static let webInspectorEnabled = "WebInspectorEnabled"
|
static let webInspectorEnabled = "WebInspectorEnabled"
|
||||||
static let webInspectorStartsAttached = "__WebInspectorPageGroupLevel1__.WebKit2InspectorStartsAttached"
|
static let webInspectorStartsAttached = "__WebInspectorPageGroupLevel1__.WebKit2InspectorStartsAttached"
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static let smallestFontSizeRawValue = FontSize.small.rawValue
|
private static let smallestFontSizeRawValue = FontSize.small.rawValue
|
||||||
@ -238,7 +236,6 @@ final class AppDefaults {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
var webInspectorEnabled: Bool {
|
var webInspectorEnabled: Bool {
|
||||||
get {
|
get {
|
||||||
return AppDefaults.bool(for: Key.webInspectorEnabled)
|
return AppDefaults.bool(for: Key.webInspectorEnabled)
|
||||||
@ -256,7 +253,6 @@ final class AppDefaults {
|
|||||||
AppDefaults.setBool(for: Key.webInspectorStartsAttached, newValue)
|
AppDefaults.setBool(for: Key.webInspectorStartsAttached, newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
var timelineSortDirection: ComparisonResult {
|
var timelineSortDirection: ComparisonResult {
|
||||||
get {
|
get {
|
||||||
|
@ -17,15 +17,7 @@ import RSCoreResources
|
|||||||
import Secrets
|
import Secrets
|
||||||
import OSLog
|
import OSLog
|
||||||
import CrashReporter
|
import CrashReporter
|
||||||
|
|
||||||
// If we're not going to import Sparkle, provide dummy protocols to make it easy
|
|
||||||
// for AppDelegate to comply
|
|
||||||
#if MAC_APP_STORE || TEST
|
|
||||||
protocol SPUStandardUserDriverDelegate {}
|
|
||||||
protocol SPUUpdaterDelegate {}
|
|
||||||
#else
|
|
||||||
import Sparkle
|
import Sparkle
|
||||||
#endif
|
|
||||||
|
|
||||||
var appDelegate: AppDelegate!
|
var appDelegate: AppDelegate!
|
||||||
|
|
||||||
@ -100,10 +92,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
private var inspectorWindowController: InspectorWindowController?
|
private var inspectorWindowController: InspectorWindowController?
|
||||||
private var crashReportWindowController: CrashReportWindowController? // For testing only
|
private var crashReportWindowController: CrashReportWindowController? // For testing only
|
||||||
private let appMovementMonitor = RSAppMovementMonitor()
|
private let appMovementMonitor = RSAppMovementMonitor()
|
||||||
#if !MAC_APP_STORE && !TEST
|
|
||||||
private var softwareUpdater: SPUUpdater!
|
private var softwareUpdater: SPUUpdater!
|
||||||
private var crashReporter: PLCrashReporter!
|
private var crashReporter: PLCrashReporter!
|
||||||
#endif
|
|
||||||
|
|
||||||
private var themeImportPath: String?
|
private var themeImportPath: String?
|
||||||
|
|
||||||
@ -111,11 +101,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
NSWindow.allowsAutomaticWindowTabbing = false
|
NSWindow.allowsAutomaticWindowTabbing = false
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
let crashReporterConfig = PLCrashReporterConfig.defaultConfiguration()
|
let crashReporterConfig = PLCrashReporterConfig.defaultConfiguration()
|
||||||
crashReporter = PLCrashReporter(configuration: crashReporterConfig)
|
crashReporter = PLCrashReporter(configuration: crashReporterConfig)
|
||||||
crashReporter.enable()
|
crashReporter.enable()
|
||||||
#endif
|
|
||||||
|
|
||||||
AccountManager.shared = AccountManager(accountsFolder: Platform.dataSubfolder(forApplication: nil, folderName: "Accounts")!)
|
AccountManager.shared = AccountManager(accountsFolder: Platform.dataSubfolder(forApplication: nil, folderName: "Accounts")!)
|
||||||
ArticleThemesManager.shared = ArticleThemesManager(folderPath: Platform.dataSubfolder(forApplication: nil, folderName: "Themes")!)
|
ArticleThemesManager.shared = ArticleThemesManager(folderPath: Platform.dataSubfolder(forApplication: nil, folderName: "Themes")!)
|
||||||
@ -171,9 +159,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
|
|
||||||
func applicationDidFinishLaunching(_ note: Notification) {
|
func applicationDidFinishLaunching(_ note: Notification) {
|
||||||
|
|
||||||
#if MAC_APP_STORE || TEST
|
|
||||||
checkForUpdatesMenuItem.isHidden = true
|
|
||||||
#else
|
|
||||||
// Initialize Sparkle...
|
// Initialize Sparkle...
|
||||||
let hostBundle = Bundle.main
|
let hostBundle = Bundle.main
|
||||||
let updateDriver = SPUStandardUserDriver(hostBundle: hostBundle, delegate: self)
|
let updateDriver = SPUStandardUserDriver(hostBundle: hostBundle, delegate: self)
|
||||||
@ -185,7 +170,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
catch {
|
catch {
|
||||||
NSLog("Failed to start software updater with error: \(error)")
|
NSLog("Failed to start software updater with error: \(error)")
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
AppDefaults.shared.registerDefaults()
|
AppDefaults.shared.registerDefaults()
|
||||||
let isFirstRun = AppDefaults.shared.isFirstRun
|
let isFirstRun = AppDefaults.shared.isFirstRun
|
||||||
@ -258,25 +242,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if AppDefaults.shared.showDebugMenu {
|
if !AppDefaults.shared.showDebugMenu {
|
||||||
// The Web Inspector uses SPI and can never appear in a MAC_APP_STORE build.
|
|
||||||
#if MAC_APP_STORE
|
|
||||||
let debugMenu = debugMenuItem.submenu!
|
|
||||||
let toggleWebInspectorItemIndex = debugMenu.indexOfItem(withTarget: self, andAction: #selector(toggleWebInspectorEnabled(_:)))
|
|
||||||
if toggleWebInspectorItemIndex != -1 {
|
|
||||||
debugMenu.removeItem(at: toggleWebInspectorItemIndex)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
debugMenuItem.menu?.removeItem(debugMenuItem)
|
debugMenuItem.menu?.removeItem(debugMenuItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
CrashReporter.check(crashReporter: self.crashReporter)
|
CrashReporter.check(crashReporter: self.crashReporter)
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([NSUserActivityRestoring]) -> Void) -> Bool {
|
func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([NSUserActivityRestoring]) -> Void) -> Bool {
|
||||||
@ -456,11 +428,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
return !isDisplayingSheet && !AccountManager.shared.activeAccounts.isEmpty
|
return !isDisplayingSheet && !AccountManager.shared.activeAccounts.isEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
if item.action == #selector(toggleWebInspectorEnabled(_:)) {
|
if item.action == #selector(toggleWebInspectorEnabled(_:)) {
|
||||||
(item as! NSMenuItem).state = AppDefaults.shared.webInspectorEnabled ? .on : .off
|
(item as! NSMenuItem).state = AppDefaults.shared.webInspectorEnabled ? .on : .off
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -682,11 +652,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func checkForUpdates(_ sender: Any?) {
|
@IBAction func checkForUpdates(_ sender: Any?) {
|
||||||
#if !MAC_APP_STORE && !TEST
|
|
||||||
self.softwareUpdater.checkForUpdates()
|
self.softwareUpdater.checkForUpdates()
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Debug Menu
|
// MARK: - Debug Menu
|
||||||
@ -728,7 +695,7 @@ extension AppDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func toggleWebInspectorEnabled(_ sender: Any?) {
|
@IBAction func toggleWebInspectorEnabled(_ sender: Any?) {
|
||||||
#if !MAC_APP_STORE
|
|
||||||
let newValue = !AppDefaults.shared.webInspectorEnabled
|
let newValue = !AppDefaults.shared.webInspectorEnabled
|
||||||
AppDefaults.shared.webInspectorEnabled = newValue
|
AppDefaults.shared.webInspectorEnabled = newValue
|
||||||
|
|
||||||
@ -737,9 +704,7 @@ extension AppDelegate {
|
|||||||
// accidentally reattached.
|
// accidentally reattached.
|
||||||
AppDefaults.shared.webInspectorStartsAttached = false
|
AppDefaults.shared.webInspectorStartsAttached = false
|
||||||
NotificationCenter.default.post(name: .WebInspectorEnabledDidChange, object: newValue)
|
NotificationCenter.default.post(name: .WebInspectorEnabledDidChange, object: newValue)
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal extension AppDelegate {
|
internal extension AppDelegate {
|
||||||
|
@ -48,7 +48,6 @@ final class DetailWebViewController: NSViewController {
|
|||||||
|
|
||||||
private var articleTextSize = AppDefaults.shared.articleTextSize
|
private var articleTextSize = AppDefaults.shared.articleTextSize
|
||||||
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
private var webInspectorEnabled: Bool {
|
private var webInspectorEnabled: Bool {
|
||||||
get {
|
get {
|
||||||
return webView.configuration.preferences._developerExtrasEnabled
|
return webView.configuration.preferences._developerExtrasEnabled
|
||||||
@ -57,7 +56,6 @@ final class DetailWebViewController: NSViewController {
|
|||||||
webView.configuration.preferences._developerExtrasEnabled = newValue
|
webView.configuration.preferences._developerExtrasEnabled = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
private let detailIconSchemeHandler = DetailIconSchemeHandler()
|
private let detailIconSchemeHandler = DetailIconSchemeHandler()
|
||||||
private var waitingForFirstReload = false
|
private var waitingForFirstReload = false
|
||||||
@ -99,10 +97,8 @@ final class DetailWebViewController: NSViewController {
|
|||||||
webView.isHidden = true
|
webView.isHidden = true
|
||||||
waitingForFirstReload = true
|
waitingForFirstReload = true
|
||||||
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
webInspectorEnabled = AppDefaults.shared.webInspectorEnabled
|
webInspectorEnabled = AppDefaults.shared.webInspectorEnabled
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(webInspectorEnabledDidChange(_:)), name: .WebInspectorEnabledDidChange, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(webInspectorEnabledDidChange(_:)), name: .WebInspectorEnabledDidChange, object: nil)
|
||||||
#endif
|
|
||||||
|
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(avatarDidBecomeAvailable(_:)), name: .AvatarDidBecomeAvailable, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(avatarDidBecomeAvailable(_:)), name: .AvatarDidBecomeAvailable, object: nil)
|
||||||
@ -322,11 +318,9 @@ private extension DetailWebViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
@objc func webInspectorEnabledDidChange(_ notification: Notification) {
|
@objc func webInspectorEnabledDidChange(_ notification: Notification) {
|
||||||
self.webInspectorEnabled = notification.object! as! Bool
|
self.webInspectorEnabled = notification.object! as! Bool
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - ScrollInfo
|
// MARK: - ScrollInfo
|
||||||
|
@ -39,16 +39,9 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
|||||||
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Accounts,
|
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Accounts,
|
||||||
name: NSLocalizedString("Accounts", comment: "Preferences"),
|
name: NSLocalizedString("Accounts", comment: "Preferences"),
|
||||||
image: AppAssets.preferencesToolbarAccountsImage)]
|
image: AppAssets.preferencesToolbarAccountsImage)]
|
||||||
|
|
||||||
// Omit the Advanced Preferences for now because the Software Update related functionality is
|
|
||||||
// forbidden/non-applicable, and we can rely upon Apple to some extent for crash reports. We
|
|
||||||
// can add back the Crash Reporter preferences when we're ready to dynamically shuffle the rest
|
|
||||||
// of the content in this tab.
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Advanced,
|
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Advanced,
|
||||||
name: NSLocalizedString("Advanced", comment: "Preferences"),
|
name: NSLocalizedString("Advanced", comment: "Preferences"),
|
||||||
image: AppAssets.preferencesToolbarAdvancedImage)]
|
image: AppAssets.preferencesToolbarAdvancedImage)]
|
||||||
#endif
|
|
||||||
return specs
|
return specs
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -12,8 +12,5 @@ import Articles
|
|||||||
extension Notification.Name {
|
extension Notification.Name {
|
||||||
static let InspectableObjectsDidChange = Notification.Name("TimelineSelectionDidChangeNotification")
|
static let InspectableObjectsDidChange = Notification.Name("TimelineSelectionDidChangeNotification")
|
||||||
static let UserDidAddFeed = Notification.Name("UserDidAddFeedNotification")
|
static let UserDidAddFeed = Notification.Name("UserDidAddFeedNotification")
|
||||||
|
|
||||||
#if !MAC_APP_STORE
|
|
||||||
static let WebInspectorEnabledDidChange = Notification.Name("WebInspectorEnabledDidChange")
|
static let WebInspectorEnabledDidChange = Notification.Name("WebInspectorEnabledDidChange")
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user