From 278fe7851b8f4845b0ccc258d7fc3635bb17d63e Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 25 May 2020 22:21:40 -0700 Subject: [PATCH 1/4] Ignore script feeds when importing NNW 3 subscriptions. Fix #1168. --- Mac/MainWindow/NNW3/NNW3Document.swift | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Mac/MainWindow/NNW3/NNW3Document.swift b/Mac/MainWindow/NNW3/NNW3Document.swift index f9bdcacc2..b90396c7b 100644 --- a/Mac/MainWindow/NNW3/NNW3Document.swift +++ b/Mac/MainWindow/NNW3/NNW3Document.swift @@ -66,7 +66,7 @@ private struct NNW3Folder { private let title: String? private let children: [OPMLRepresentable]? - + init(plist: [String: Any]) { self.title = plist["name"] as? String guard let childrenArray = plist["childrenArray"] as? [[String: Any]] else { @@ -75,16 +75,20 @@ private struct NNW3Folder { } self.children = NNW3Folder.itemsWithPlist(plist: childrenArray) } - + static func itemsWithPlist(plist: [[String: Any]]) -> [OPMLRepresentable]? { // Also used by NNW3Document. var items = [OPMLRepresentable]() - for child in plist { + plist.forEach { child in if child["isContainer"] as? Bool ?? false { items.append(NNW3Folder(plist: child)) - } else { - items.append(NNW3Feed(plist: child)) + return } + if child["isScript"] as? Bool ?? false { + // Ignore script feeds. + return + } + items.append(NNW3Feed(plist: child)) } return items.isEmpty ? nil : items } From 56f597735a4d25dc409f9a877c7b589db8a4e7e2 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 27 May 2020 21:39:58 -0700 Subject: [PATCH 2/4] Update to latest RSCore. --- submodules/RSCore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/RSCore b/submodules/RSCore index 34e67f8b5..4a90ca588 160000 --- a/submodules/RSCore +++ b/submodules/RSCore @@ -1 +1 @@ -Subproject commit 34e67f8b5f566c29b60bbf6d31331334da0711fe +Subproject commit 4a90ca5888047110ac8cb7083ca6a0b6cf4dcb9c From 1e4a8a86ec48f5ef556e9db5b0f4e12f551f4385 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 27 May 2020 22:15:19 -0700 Subject: [PATCH 3/4] Replace firstElementPassingTest with first(where). --- Mac/MainWindow/Timeline/Cell/SingleLineTextFieldSizer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mac/MainWindow/Timeline/Cell/SingleLineTextFieldSizer.swift b/Mac/MainWindow/Timeline/Cell/SingleLineTextFieldSizer.swift index ed18581e9..e40db7235 100644 --- a/Mac/MainWindow/Timeline/Cell/SingleLineTextFieldSizer.swift +++ b/Mac/MainWindow/Timeline/Cell/SingleLineTextFieldSizer.swift @@ -53,7 +53,7 @@ final class SingleLineTextFieldSizer { // that members of such a dictionary were mutated after insertion. // We use just an array of sizers now — which is totally fine, // because there’s only going to be like three of them. - if let cachedSizer = sizers.firstElementPassingTest({ $0.font == font }) { + if let cachedSizer = sizers.first(where: { $0.font == font }) { return cachedSizer } From 210df4957ecba8cbb6c5de0eda2703780fae93b7 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 27 May 2020 22:15:49 -0700 Subject: [PATCH 4/4] =?UTF-8?q?Make=20the=20sidebar=E2=80=99s=20outline=20?= =?UTF-8?q?view=20first=20responder=20on=20startup.=20Fixes=20#1262.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mac/MainWindow/Sidebar/SidebarViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mac/MainWindow/Sidebar/SidebarViewController.swift b/Mac/MainWindow/Sidebar/SidebarViewController.swift index a14fe0dba..d388bf811 100644 --- a/Mac/MainWindow/Sidebar/SidebarViewController.swift +++ b/Mac/MainWindow/Sidebar/SidebarViewController.swift @@ -75,6 +75,10 @@ protocol SidebarDelegate: class { } row += 1 } + + DispatchQueue.main.async { + self.outlineView.window?.makeFirstResponder(self.outlineView) + } } // MARK: - Notifications