mirror of https://github.com/buresdv/Cork
^ Compilation errors
This commit is contained in:
parent
b9620a952c
commit
7b34c903b2
|
|
@ -90,7 +90,7 @@ class AppDelegate: NSObject, NSApplicationDelegate
|
|||
updatePackagesMenuItem.action = #selector(appState.startUpdateProcessForLegacySelectors(_:))
|
||||
updatePackagesMenuItem.target = appState
|
||||
|
||||
if outdatedPackageTracker.isCheckingForPackageUpdates
|
||||
if outdatedPackagesTracker.isCheckingForPackageUpdates
|
||||
{
|
||||
updatePackagesMenuItem.title = String(localized: "start-page.updates.loading")
|
||||
updatePackagesMenuItem.isEnabled = false
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ struct ContentView: View, Sendable
|
|||
}
|
||||
}
|
||||
.help("navigation.upgrade-packages.help")
|
||||
.disabled(self.outdatedPackageTracker.isCheckingForPackageUpdates)
|
||||
.disabled(self.outdatedPackagesTracker.isCheckingForPackageUpdates)
|
||||
}
|
||||
|
||||
@ViewBuilder private var addTapButton: some View
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ struct CorkApp: App
|
|||
// TODO: Remove this once I figure out why the updating spinner sometimes doesn't disappear
|
||||
withAnimation
|
||||
{
|
||||
outdatedPackageTracker.isCheckingForPackageUpdates = false
|
||||
outdatedPackagesTracker.isCheckingForPackageUpdates = false
|
||||
}
|
||||
|
||||
if outdatedPackageCount == 0
|
||||
|
|
@ -663,7 +663,7 @@ struct CorkApp: App
|
|||
CheckForOutdatedPackagesButton()
|
||||
.keyboardShortcut("r")
|
||||
.environment(appDelegate.appState)
|
||||
.environment(outdatedPackageTracker)
|
||||
.environment(outdatedPackagesTracker)
|
||||
|
||||
Button
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ extension BrewPackagesTracker
|
|||
shouldRemoveAllAssociatedFiles: Bool
|
||||
) async throws
|
||||
{
|
||||
/// Store the old navigation selection to see if it got updated in the middle of switching
|
||||
let oldNavigationSelectionId: UUID? = appState.navigationTargetId
|
||||
|
||||
self.updatePackageInPlace(package)
|
||||
{ package in
|
||||
|
|
@ -94,15 +92,6 @@ extension BrewPackagesTracker
|
|||
else
|
||||
{
|
||||
AppConstants.shared.logger.info("Uninstalling can proceed")
|
||||
|
||||
if appState.navigationTargetId != nil
|
||||
{
|
||||
/// Switch to the status page only if the user didn't open another details window in the middle of the uninstall process
|
||||
if oldNavigationSelectionId == appState.navigationTargetId
|
||||
{
|
||||
appState.navigationTargetId = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch let synchronizationError
|
||||
|
|
|
|||
|
|
@ -28,9 +28,6 @@ func removeTap(name: String, tapTracker: TapTracker, appState: AppState, shouldA
|
|||
{
|
||||
var indexToReplaceGlobal: Int?
|
||||
|
||||
/// Store the old navigation selection to see if it got updated in the middle of switching
|
||||
let oldNavigationTargetId: UUID? = appState.navigationTargetId
|
||||
|
||||
if shouldApplyUninstallSpinnerToRelevantItemInSidebar
|
||||
{
|
||||
if let indexToReplace = tapTracker.addedTaps.firstIndex(where: { $0.name == name })
|
||||
|
|
@ -63,15 +60,6 @@ func removeTap(name: String, tapTracker: TapTracker, appState: AppState, shouldA
|
|||
tapTracker.addedTaps.removeAll(where: { $0.name == name })
|
||||
}
|
||||
}
|
||||
|
||||
if appState.navigationTargetId != nil
|
||||
{
|
||||
/// Switch to the status page only if the user didn't open another details window in the middle of the tap removal process
|
||||
if oldNavigationTargetId == appState.navigationTargetId
|
||||
{
|
||||
appState.navigationTargetId = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ class OutdatedPackagesTracker
|
|||
|
||||
@ObservableDefault(.includeGreedyOutdatedPackages) @ObservationIgnored var includeGreedyOutdatedPackages: Bool
|
||||
|
||||
var outdatedPackages: Set<OutdatedPackage> = .init()
|
||||
enum OutdatedPackageDisplayStage: Equatable
|
||||
{
|
||||
case checkingForUpdates, showingOutdatedPackages, noUpdatesAvailable, erroredOut(reason: String)
|
||||
|
|
@ -87,7 +86,7 @@ extension OutdatedPackagesTracker
|
|||
}
|
||||
}
|
||||
|
||||
extension OutdatedPackageTracker
|
||||
extension OutdatedPackagesTracker
|
||||
{
|
||||
func checkForUpdates()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct MenuBar_PackageUpdating: View
|
|||
|
||||
var body: some View
|
||||
{
|
||||
if outdatedPackageTracker.isCheckingForPackageUpdates
|
||||
if outdatedPackagesTracker.isCheckingForPackageUpdates
|
||||
{
|
||||
Text("start-page.updates.loading")
|
||||
.disabled(true)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import CorkShared
|
|||
struct CheckForOutdatedPackagesButton: View
|
||||
{
|
||||
@Environment(AppState.self) var appState: AppState
|
||||
@EnvironmentObject var outdatedPackagesTracker: OutdatedPackageTracker
|
||||
@Environment(OutdatedPackagesTracker.self) var outdatedPackagesTracker: OutdatedPackagesTracker
|
||||
|
||||
var body: some View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -120,41 +120,6 @@ struct StartPage: View
|
|||
}
|
||||
}
|
||||
}
|
||||
.task
|
||||
{
|
||||
if outdatedPackagesTracker.outdatedPackages.isEmpty
|
||||
{
|
||||
appState.isCheckingForPackageUpdates = true
|
||||
|
||||
defer
|
||||
{
|
||||
withAnimation
|
||||
{
|
||||
appState.isCheckingForPackageUpdates = false
|
||||
}
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
try await outdatedPackagesTracker.getOutdatedPackages(brewPackagesTracker: brewPackagesTracker)
|
||||
}
|
||||
catch let outdatedPackageRetrievalError as OutdatedPackageRetrievalError
|
||||
{
|
||||
switch outdatedPackageRetrievalError
|
||||
{
|
||||
case .homeNotSet:
|
||||
appState.showAlert(errorToShow: .homePathNotSet)
|
||||
default:
|
||||
AppConstants.shared.logger.error("Could not decode outdated package command output: \(outdatedPackageRetrievalError.localizedDescription)")
|
||||
errorOutReason = outdatedPackageRetrievalError.localizedDescription
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
AppConstants.shared.logger.error("Unspecified error while pulling package updates")
|
||||
}
|
||||
}
|
||||
}
|
||||
.transition(.push(from: .top))
|
||||
|
||||
ButtonBottomRow
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ struct OutdatedPackagesBox: View
|
|||
{
|
||||
Group
|
||||
{
|
||||
switch outdatedPackageTracker.outdatedPackageDisplayStage
|
||||
switch outdatedPackagesTracker.outdatedPackageDisplayStage
|
||||
{
|
||||
case .checkingForUpdates:
|
||||
OutdatedPackageLoaderBox(errorOutReason: $outdatedPackageTracker.errorOutReason)
|
||||
OutdatedPackageLoaderBox(errorOutReason: Bindable(outdatedPackagesTracker).errorOutReason)
|
||||
case .showingOutdatedPackages:
|
||||
OutdatedPackageListBox(isDropdownExpanded: $isOutdatedPackageDropdownExpanded)
|
||||
case .noUpdatesAvailable:
|
||||
|
|
@ -36,6 +36,6 @@ struct OutdatedPackagesBox: View
|
|||
LoadingOfOutdatedPackagesFailedListBox(errorOutReason: reason)
|
||||
}
|
||||
}
|
||||
.animation(.snappy, value: outdatedPackageTracker.outdatedPackageDisplayStage)
|
||||
.animation(.snappy, value: outdatedPackagesTracker.outdatedPackageDisplayStage)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ struct OutdatedPackageLoaderBox: View
|
|||
}
|
||||
.task
|
||||
{
|
||||
outdatedPackageTracker.isCheckingForPackageUpdates = true
|
||||
outdatedPackagesTracker.isCheckingForPackageUpdates = true
|
||||
|
||||
defer
|
||||
{
|
||||
withAnimation
|
||||
{
|
||||
outdatedPackageTracker.isCheckingForPackageUpdates = false
|
||||
outdatedPackagesTracker.isCheckingForPackageUpdates = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,11 +117,11 @@ struct UpdateSomePackagesView: View
|
|||
{
|
||||
do
|
||||
{
|
||||
outdatedPackageTracker.isCheckingForPackageUpdates = true
|
||||
outdatedPackagesTracker.isCheckingForPackageUpdates = true
|
||||
|
||||
defer
|
||||
{
|
||||
outdatedPackageTracker.isCheckingForPackageUpdates = false
|
||||
outdatedPackagesTracker.isCheckingForPackageUpdates = false
|
||||
}
|
||||
|
||||
AppConstants.shared.logger.debug("Will synchronize outdated packages")
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// swiftlint:disable:this file_name
|
||||
// swiftlint:disable all
|
||||
// swift-format-ignore-file
|
||||
// swiftformat:disable all
|
||||
|
|
@ -14,11 +15,8 @@
|
|||
import SwiftUI
|
||||
#endif
|
||||
|
||||
// swiftlint:disable superfluous_disable_command file_length implicit_return
|
||||
|
||||
// MARK: - Asset Catalogs
|
||||
|
||||
// swiftlint:disable identifier_name line_length nesting type_body_length type_name
|
||||
public enum CorkAsset: Sendable {
|
||||
public enum Assets {
|
||||
public static let accentColor = CorkColors(name: "AccentColor")
|
||||
|
|
@ -38,7 +36,6 @@ public enum CorkAsset: Sendable {
|
|||
public enum PreviewAssets {
|
||||
}
|
||||
}
|
||||
// swiftlint:enable identifier_name line_length nesting type_body_length type_name
|
||||
|
||||
// MARK: - Implementation Details
|
||||
|
||||
|
|
@ -147,5 +144,5 @@ public extension SwiftUI.Image {
|
|||
}
|
||||
#endif
|
||||
|
||||
// swiftlint:enable all
|
||||
// swiftformat:enable all
|
||||
// swiftlint:enable all
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// swiftlint:disable:this file_name
|
||||
// swiftlint:disable all
|
||||
// swift-format-ignore-file
|
||||
// swiftformat:disable all
|
||||
|
|
@ -14,11 +15,8 @@
|
|||
import SwiftUI
|
||||
#endif
|
||||
|
||||
// swiftlint:disable superfluous_disable_command file_length implicit_return
|
||||
|
||||
// MARK: - Asset Catalogs
|
||||
|
||||
// swiftlint:disable identifier_name line_length nesting type_body_length type_name
|
||||
public enum CorkAsset: Sendable {
|
||||
public enum Assets {
|
||||
public static let accentColor = CorkColors(name: "AccentColor")
|
||||
|
|
@ -38,7 +36,6 @@ public enum CorkAsset: Sendable {
|
|||
public enum PreviewAssets {
|
||||
}
|
||||
}
|
||||
// swiftlint:enable identifier_name line_length nesting type_body_length type_name
|
||||
|
||||
// MARK: - Implementation Details
|
||||
|
||||
|
|
@ -147,5 +144,5 @@ public extension SwiftUI.Image {
|
|||
}
|
||||
#endif
|
||||
|
||||
// swiftlint:enable all
|
||||
// swiftformat:enable all
|
||||
// swiftlint:enable all
|
||||
|
|
|
|||
|
|
@ -1,16 +1,25 @@
|
|||
// periphery:ignore:all
|
||||
// swiftlint:disable:this file_name
|
||||
// swiftlint:disable all
|
||||
// swift-format-ignore-file
|
||||
// swiftformat:disable all
|
||||
import Foundation// MARK: - Swift Bundle Accessor for Frameworks
|
||||
#if hasFeature(InternalImportsByDefault)
|
||||
public import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
// MARK: - Swift Bundle Accessor for Frameworks
|
||||
private class BundleFinder {}
|
||||
extension Foundation.Bundle {
|
||||
/// Since Cork is a application, the bundle for classes within this module can be used directly.
|
||||
static let module = Bundle(for: BundleFinder.self)
|
||||
}// MARK: - Objective-C Bundle Accessor
|
||||
static let module = Bundle(for: BundleFinder.self)
|
||||
}
|
||||
// MARK: - Objective-C Bundle Accessor
|
||||
@objc
|
||||
public class CorkResources: NSObject {
|
||||
@objc public class var bundle: Bundle {
|
||||
return .module
|
||||
}
|
||||
}// swiftlint:enable all
|
||||
// swiftformat:enable all
|
||||
}
|
||||
// swiftformat:enable all
|
||||
// swiftlint:enable all
|
||||
|
|
@ -1,16 +1,25 @@
|
|||
// periphery:ignore:all
|
||||
// swiftlint:disable:this file_name
|
||||
// swiftlint:disable all
|
||||
// swift-format-ignore-file
|
||||
// swiftformat:disable all
|
||||
import Foundation// MARK: - Swift Bundle Accessor for Frameworks
|
||||
#if hasFeature(InternalImportsByDefault)
|
||||
public import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
// MARK: - Swift Bundle Accessor for Frameworks
|
||||
private class BundleFinder {}
|
||||
extension Foundation.Bundle {
|
||||
/// Since Self-Compiled is a application, the bundle for classes within this module can be used directly.
|
||||
static let module = Bundle(for: BundleFinder.self)
|
||||
}// MARK: - Objective-C Bundle Accessor
|
||||
static let module = Bundle(for: BundleFinder.self)
|
||||
}
|
||||
// MARK: - Objective-C Bundle Accessor
|
||||
@objc
|
||||
public class CorkResources: NSObject {
|
||||
@objc public class var bundle: Bundle {
|
||||
return .module
|
||||
}
|
||||
}// swiftlint:enable all
|
||||
// swiftformat:enable all
|
||||
}
|
||||
// swiftformat:enable all
|
||||
// swiftlint:enable all
|
||||
Loading…
Reference in New Issue