Fix canImport(Sparkle)

This commit is contained in:
1024jp 2018-04-15 22:49:42 +09:00
parent be40aab919
commit c767a00ed9
4 changed files with 5 additions and 4 deletions

View File

@ -8,6 +8,7 @@ unreleased
### Fixes
- Fix an issue where the sidebar inspector did close inward when the pane was switched after opening the sidebar outward.
- [beta][non-AppStore ver.] Fix an issue where options for the application update check in General preferences pane disappeared.

View File

@ -316,10 +316,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
@IBAction func showAboutPanel(_ sender: Any?) {
var options: [NSApplication.AboutPanelOptionKey: Any] = [:]
#if canImport(Sparkle)
#if !canImport(Sparkle)
// Remove Sparkle from 3rd party code list
if let creditsURL = Bundle.main.url(forResource: "Credits", withExtension: "html"),
let attrString = try? NSMutableAttributedString(url: creditsURL, options: [:], documentAttributes: nil),
let attrString = try? NSMutableAttributedString(url: creditsURL, documentAttributes: nil),
let range = attrString.string.range(of: "Sparkle.*\\n", options: .regularExpression)
{
attrString.replaceCharacters(in: NSRange(range, in: attrString.string), with: "")

View File

@ -44,7 +44,7 @@ final class GeneralPaneController: NSViewController {
super.viewDidLoad()
// remove updater options if no Sparkle provided
#if canImport(Sparkle)
#if !canImport(Sparkle)
for subview in self.view.subviews where subview.tag < 0 {
subview.removeFromSuperview()
}

View File

@ -95,7 +95,7 @@ extension WebDocumentViewController: WKNavigationDelegate {
/// receive web content
func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) {
#if canImport(Sparkle)
#if !canImport(Sparkle)
webView.apply(styleSheet: ".Sparkle { display: none }")
#endif
}