From 1c0dae4bedcabda5378a0f6d67bb2fbe80e1237d Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Wed, 8 Jun 2022 01:14:47 +0200 Subject: [PATCH] Remove Sparkle update framework --- Shared/Settings/SettingsView.swift | 12 +----- Shared/YatteeApp.swift | 9 ---- Yattee.xcodeproj/project.pbxproj | 37 ----------------- .../xcshareddata/swiftpm/Package.resolved | 9 ---- macOS/Updates/CheckForUpdatesView.swift | 10 ----- macOS/Updates/UpdaterModel.swift | 41 ------------------- macOS/Updates/UpdatesSettings.swift | 37 ----------------- 7 files changed, 1 insertion(+), 154 deletions(-) delete mode 100644 macOS/Updates/CheckForUpdatesView.swift delete mode 100644 macOS/Updates/UpdaterModel.swift delete mode 100644 macOS/Updates/UpdatesSettings.swift diff --git a/Shared/Settings/SettingsView.swift b/Shared/Settings/SettingsView.swift index 5a792192..624ab435 100644 --- a/Shared/Settings/SettingsView.swift +++ b/Shared/Settings/SettingsView.swift @@ -5,7 +5,7 @@ import SwiftUI struct SettingsView: View { #if os(macOS) private enum Tabs: Hashable { - case instances, browsing, player, history, sponsorBlock, updates, help + case instances, browsing, player, history, sponsorBlock, help } @State private var selection = Tabs.instances @@ -68,14 +68,6 @@ struct SettingsView: View { } .tag(Tabs.sponsorBlock) - Form { - UpdatesSettings() - } - .tabItem { - Label("Updates", systemImage: "gearshape.2") - } - .tag(Tabs.updates) - Form { Help() } @@ -184,8 +176,6 @@ struct SettingsView: View { return 480 case .sponsorBlock: return 660 - case .updates: - return 200 case .help: return 570 } diff --git a/Shared/YatteeApp.swift b/Shared/YatteeApp.swift index 7d56af85..8d294f46 100644 --- a/Shared/YatteeApp.swift +++ b/Shared/YatteeApp.swift @@ -13,7 +13,6 @@ struct YatteeApp: App { #if os(macOS) @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate - @StateObject private var updater = UpdaterModel() #elseif os(iOS) @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate #endif @@ -80,13 +79,6 @@ struct YatteeApp: App { CommandGroup(replacing: .newItem, addition: {}) - #if os(macOS) - CommandGroup(after: .appInfo) { - CheckForUpdatesView() - .environmentObject(updater) - } - #endif - MenuCommands(model: Binding(get: { menu }, set: { _ in })) } #endif @@ -134,7 +126,6 @@ struct YatteeApp: App { .environmentObject(instances) .environmentObject(player) .environmentObject(playerControls) - .environmentObject(updater) } #endif } diff --git a/Yattee.xcodeproj/project.pbxproj b/Yattee.xcodeproj/project.pbxproj index d88fda9c..d9de8027 100644 --- a/Yattee.xcodeproj/project.pbxproj +++ b/Yattee.xcodeproj/project.pbxproj @@ -63,7 +63,6 @@ 3703100227B0713600ECDDAA /* PlayerGestures.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3703100127B0713600ECDDAA /* PlayerGestures.swift */; }; 3703100327B0713600ECDDAA /* PlayerGestures.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3703100127B0713600ECDDAA /* PlayerGestures.swift */; }; 3703205827D2BAE4007A0CB8 /* Siesta in Frameworks */ = {isa = PBXBuildFile; productRef = 3703205727D2BAE4007A0CB8 /* Siesta */; }; - 3703205A27D2BAE9007A0CB8 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 3703205927D2BAE9007A0CB8 /* Sparkle */; }; 3703205C27D2BAF3007A0CB8 /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = 3703205B27D2BAF3007A0CB8 /* SwiftyJSON */; }; 3703205E27D2BB12007A0CB8 /* SDWebImageWebPCoder in Frameworks */ = {isa = PBXBuildFile; productRef = 3703205D27D2BB12007A0CB8 /* SDWebImageWebPCoder */; }; 3703206027D2BB16007A0CB8 /* SDWebImageSwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = 3703205F27D2BB16007A0CB8 /* SDWebImageSwiftUI */; }; @@ -567,7 +566,6 @@ 37BE0BD726A1D4A90092E2DB /* AppleAVPlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BE0BD526A1D4A90092E2DB /* AppleAVPlayerViewController.swift */; }; 37BE0BDA26A214630092E2DB /* AppleAVPlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BE0BD926A214630092E2DB /* AppleAVPlayerViewController.swift */; }; 37BE0BDC26A2367F0092E2DB /* AppleAVPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BE0BDB26A2367F0092E2DB /* AppleAVPlayerView.swift */; }; - 37BE7AF12760013C00DBECED /* UpdatesSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BE7AF02760013C00DBECED /* UpdatesSettings.swift */; }; 37BF661C27308859008CCFB0 /* DropFavorite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BF661B27308859008CCFB0 /* DropFavorite.swift */; }; 37BF661D27308859008CCFB0 /* DropFavorite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BF661B27308859008CCFB0 /* DropFavorite.swift */; }; 37BF661F27308884008CCFB0 /* DropFavoriteOutside.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BF661E27308884008CCFB0 /* DropFavoriteOutside.swift */; }; @@ -611,8 +609,6 @@ 37C7A1D6267BFD9D0010EAD6 /* SponsorBlockSegment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C7A1D4267BFD9D0010EAD6 /* SponsorBlockSegment.swift */; }; 37C7A1D7267BFD9D0010EAD6 /* SponsorBlockSegment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C7A1D4267BFD9D0010EAD6 /* SponsorBlockSegment.swift */; }; 37C7A1DA267CACF50010EAD6 /* TrendingCountry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3705B17F267B4DFB00704544 /* TrendingCountry.swift */; }; - 37C90AF1275F9D450015EAF7 /* UpdaterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C90AF0275F9D450015EAF7 /* UpdaterModel.swift */; }; - 37C90AF3275F9D5D0015EAF7 /* CheckForUpdatesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C90AF2275F9D5D0015EAF7 /* CheckForUpdatesView.swift */; }; 37CB12792724C76D00213B45 /* VideoURLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37CB12782724C76D00213B45 /* VideoURLParser.swift */; }; 37CB127A2724C76D00213B45 /* VideoURLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37CB12782724C76D00213B45 /* VideoURLParser.swift */; }; 37CB128B2724CC1F00213B45 /* VideoURLParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37CB127B2724C79D00213B45 /* VideoURLParserTests.swift */; }; @@ -1024,7 +1020,6 @@ 37BE0BD526A1D4A90092E2DB /* AppleAVPlayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleAVPlayerViewController.swift; sourceTree = ""; }; 37BE0BD926A214630092E2DB /* AppleAVPlayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleAVPlayerViewController.swift; sourceTree = ""; }; 37BE0BDB26A2367F0092E2DB /* AppleAVPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleAVPlayerView.swift; sourceTree = ""; }; - 37BE7AF02760013C00DBECED /* UpdatesSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdatesSettings.swift; sourceTree = ""; }; 37BF661B27308859008CCFB0 /* DropFavorite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropFavorite.swift; sourceTree = ""; }; 37BF661E27308884008CCFB0 /* DropFavoriteOutside.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropFavoriteOutside.swift; sourceTree = ""; }; 37C069772725962F00F7F6CB /* ScreenSaverManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenSaverManager.swift; sourceTree = ""; }; @@ -1048,8 +1043,6 @@ 37C3A24C272360470087A57A /* ChannelPlaylist+Fixtures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ChannelPlaylist+Fixtures.swift"; sourceTree = ""; }; 37C3A250272366440087A57A /* ChannelPlaylistView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelPlaylistView.swift; sourceTree = ""; }; 37C7A1D4267BFD9D0010EAD6 /* SponsorBlockSegment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SponsorBlockSegment.swift; sourceTree = ""; }; - 37C90AF0275F9D450015EAF7 /* UpdaterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdaterModel.swift; sourceTree = ""; }; - 37C90AF2275F9D5D0015EAF7 /* CheckForUpdatesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckForUpdatesView.swift; sourceTree = ""; }; 37CB12782724C76D00213B45 /* VideoURLParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoURLParser.swift; sourceTree = ""; }; 37CB127B2724C79D00213B45 /* VideoURLParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoURLParserTests.swift; sourceTree = ""; }; 37CC3F44270CE30600608308 /* PlayerQueueItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerQueueItem.swift; sourceTree = ""; }; @@ -1178,7 +1171,6 @@ 370F4FE127CC16CB001B35DC /* libuchardet.0.0.7.dylib in Frameworks */, 370F4FDB27CC16CB001B35DC /* libswscale.6.4.100.dylib in Frameworks */, 370F4FDC27CC16CB001B35DC /* libavutil.57.17.100.dylib in Frameworks */, - 3703205A27D2BAE9007A0CB8 /* Sparkle in Frameworks */, 370F4FE327CC16CB001B35DC /* libbrotlicommon.1.dylib in Frameworks */, 3703205827D2BAE4007A0CB8 /* Siesta in Frameworks */, 370F4FD127CC16CB001B35DC /* libavfilter.8.24.100.dylib in Frameworks */, @@ -1703,7 +1695,6 @@ 37BE0BD826A214500092E2DB /* macOS */ = { isa = PBXGroup; children = ( - 37BE7AF227601DBF00DBECED /* Updates */, 374C0542272496E4009BDDBE /* AppDelegate.swift */, 37BE0BDB26A2367F0092E2DB /* AppleAVPlayerView.swift */, 37BE0BD926A214630092E2DB /* AppleAVPlayerViewController.swift */, @@ -1719,16 +1710,6 @@ path = macOS; sourceTree = ""; }; - 37BE7AF227601DBF00DBECED /* Updates */ = { - isa = PBXGroup; - children = ( - 37C90AF2275F9D5D0015EAF7 /* CheckForUpdatesView.swift */, - 37C90AF0275F9D450015EAF7 /* UpdaterModel.swift */, - 37BE7AF02760013C00DBECED /* UpdatesSettings.swift */, - ); - path = Updates; - sourceTree = ""; - }; 37C7A9022679058300E721B4 /* Extensions */ = { isa = PBXGroup; children = ( @@ -2091,7 +2072,6 @@ name = "Yattee (macOS)"; packageProductDependencies = ( 3703205727D2BAE4007A0CB8 /* Siesta */, - 3703205927D2BAE9007A0CB8 /* Sparkle */, 3703205B27D2BAF3007A0CB8 /* SwiftyJSON */, 3703205D27D2BB12007A0CB8 /* SDWebImageWebPCoder */, 3703205F27D2BB16007A0CB8 /* SDWebImageSwiftUI */, @@ -2265,7 +2245,6 @@ 37FB2847272207F000A57617 /* XCRemoteSwiftPackageReference "SDWebImageWebPCoder" */, 37FB285227220D8400A57617 /* XCRemoteSwiftPackageReference "SDWebImagePINPlugin" */, 3765917827237D07009F956E /* XCRemoteSwiftPackageReference "PINCache" */, - 37C90AED275F9CC00015EAF7 /* XCRemoteSwiftPackageReference "Sparkle" */, 37ABBC53284FDACE003DC934 /* XCRemoteSwiftPackageReference "SDWebImage" */, ); productRefGroup = 37D4B0CA2671614900C925CA /* Products */; @@ -2719,7 +2698,6 @@ 3788AC2826F6840700F6BAA9 /* FavoriteItemView.swift in Sources */, 378AE93A274EDFAF006A4EE1 /* Badge+Backport.swift in Sources */, 37599F35272B44000087F250 /* FavoritesModel.swift in Sources */, - 37C90AF3275F9D5D0015EAF7 /* CheckForUpdatesView.swift in Sources */, 37F64FE526FE70A60081B69E /* RedrawOnModifier.swift in Sources */, 3795593727B08538007FF8F4 /* StreamControl.swift in Sources */, 37FFC441272734C3009FFD26 /* Throttle.swift in Sources */, @@ -2737,7 +2715,6 @@ 37BC50AD2778BCBA00510953 /* HistoryModel.swift in Sources */, 37030FF827B0347C00ECDDAA /* MPVPlayerView.swift in Sources */, 378E50FC26FE8B9F00F49626 /* Instance.swift in Sources */, - 37BE7AF12760013C00DBECED /* UpdatesSettings.swift in Sources */, 37169AA32729D98A0011DE61 /* InstancesBridge.swift in Sources */, 37B044B826F7AB9000E1419D /* SettingsView.swift in Sources */, 3765788A2685471400D4EA09 /* Playlist.swift in Sources */, @@ -2760,7 +2737,6 @@ 372915E72687E3B900F5A35B /* Defaults.swift in Sources */, 37C3A242272359900087A57A /* Double+Format.swift in Sources */, 37B795912771DAE0001CF27B /* OpenURLHandler.swift in Sources */, - 37C90AF1275F9D450015EAF7 /* UpdaterModel.swift in Sources */, 37DD87C8271C9CFE0027CBF9 /* PlayerStreams.swift in Sources */, 376578922685490700D4EA09 /* PlaylistsView.swift in Sources */, 371114F027B951B800C2EF7B /* ToggleBackendButton.swift in Sources */, @@ -3958,14 +3934,6 @@ minimumVersion = 0.1.3; }; }; - 37C90AED275F9CC00015EAF7 /* XCRemoteSwiftPackageReference "Sparkle" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/sparkle-project/Sparkle"; - requirement = { - branch = 2.x; - kind = branch; - }; - }; 37D4B19B2671817900C925CA /* XCRemoteSwiftPackageReference "SwiftyJSON" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SwiftyJSON/SwiftyJSON.git"; @@ -4006,11 +3974,6 @@ package = 3797757B268922D100DD52A8 /* XCRemoteSwiftPackageReference "siesta" */; productName = Siesta; }; - 3703205927D2BAE9007A0CB8 /* Sparkle */ = { - isa = XCSwiftPackageProductDependency; - package = 37C90AED275F9CC00015EAF7 /* XCRemoteSwiftPackageReference "Sparkle" */; - productName = Sparkle; - }; 3703205B27D2BAF3007A0CB8 /* SwiftyJSON */ = { isa = XCSwiftPackageProductDependency; package = 37D4B19B2671817900C925CA /* XCRemoteSwiftPackageReference "SwiftyJSON" */; diff --git a/Yattee.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Yattee.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 510dd27f..44196494 100644 --- a/Yattee.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Yattee.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -90,15 +90,6 @@ "version" : "1.5.2" } }, - { - "identity" : "sparkle", - "kind" : "remoteSourceControl", - "location" : "https://github.com/sparkle-project/Sparkle", - "state" : { - "branch" : "2.x", - "revision" : "2c81393ec25a463c393f4a04ae4405571df0291d" - } - }, { "identity" : "swift-log", "kind" : "remoteSourceControl", diff --git a/macOS/Updates/CheckForUpdatesView.swift b/macOS/Updates/CheckForUpdatesView.swift deleted file mode 100644 index db7ee99a..00000000 --- a/macOS/Updates/CheckForUpdatesView.swift +++ /dev/null @@ -1,10 +0,0 @@ -import SwiftUI - -struct CheckForUpdatesView: View { - @EnvironmentObject private var updater - - var body: some View { - Button("Check For Updates…", action: updater.checkForUpdates) - .disabled(!updater.canCheckForUpdates) - } -} diff --git a/macOS/Updates/UpdaterModel.swift b/macOS/Updates/UpdaterModel.swift deleted file mode 100644 index 5fb17565..00000000 --- a/macOS/Updates/UpdaterModel.swift +++ /dev/null @@ -1,41 +0,0 @@ -import Defaults -import Sparkle -import SwiftUI - -final class UpdaterModel: ObservableObject { - @Published var canCheckForUpdates = false - - private let updaterController: SPUStandardUpdaterController - private let updaterDelegate = UpdaterDelegate() - - init() { - updaterController = SPUStandardUpdaterController( - startingUpdater: true, - updaterDelegate: updaterDelegate, - userDriverDelegate: nil - ) - - updaterController.updater.publisher(for: \.canCheckForUpdates) - .assign(to: &$canCheckForUpdates) - } - - func checkForUpdates() { - updaterController.checkForUpdates(nil) - } - - var automaticallyChecksForUpdates: Bool { - updaterController.updater.automaticallyChecksForUpdates - } - - func setAutomaticallyChecksForUpdates(_ value: Bool) { - updaterController.updater.automaticallyChecksForUpdates = value - } -} - -final class UpdaterDelegate: NSObject, SPUUpdaterDelegate { - @Default(.enableBetaChannel) private var enableBetaChannel - - func allowedChannels(for _: SPUUpdater) -> Set { - Set(enableBetaChannel ? ["beta"] : []) - } -} diff --git a/macOS/Updates/UpdatesSettings.swift b/macOS/Updates/UpdatesSettings.swift deleted file mode 100644 index 4668de43..00000000 --- a/macOS/Updates/UpdatesSettings.swift +++ /dev/null @@ -1,37 +0,0 @@ -import Defaults -import SwiftUI - -struct UpdatesSettings: View { - @EnvironmentObject private var updater - - @State private var automaticallyChecksForUpdates = false - @Default(.enableBetaChannel) private var enableBetaChannel - - var body: some View { - Section(header: SettingsHeader(text: "Updates")) { - Toggle("Check automatically", isOn: $automaticallyChecksForUpdates) - Toggle("Enable beta channel", isOn: $enableBetaChannel) - } - .onAppear { - automaticallyChecksForUpdates = updater.automaticallyChecksForUpdates - } - .onChange(of: automaticallyChecksForUpdates) { _ in - updater.setAutomaticallyChecksForUpdates(automaticallyChecksForUpdates) - } - .frame(maxWidth: .infinity, alignment: .leading) - - Spacer() - - Text("Yattee \(YatteeApp.version) (build \(YatteeApp.build))") - .foregroundColor(.secondary) - - CheckForUpdatesView() - } -} - -struct UpdatesSettings_Previews: PreviewProvider { - static var previews: some View { - UpdatesSettings() - .injectFixtureEnvironmentObjects() - } -}