Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
alienator88 committed Aug 1, 2024
1 parent 2da3da9 commit e0d41e7
Show file tree
Hide file tree
Showing 17 changed files with 357 additions and 232 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"originHash" : "284df40ab461728f91e9fff8f6afbaf9f1121ce265b549a5187092a1097d4db1",
"originHash" : "bebe4a176f4f3b9e625a60cb3048363d2aeb03aa06dabf97821c3b73b1c5f149",
"pins" : [
{
"identity" : "alinfoundation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/alienator88/AlinFoundation",
"state" : {
"branch" : "main",
"revision" : "d660e9a1fb07ec3fa036c89c6f9fc1d573cecf9e"
"revision" : "986ac354d2a01f87ed4c37d19ce80a752a62fd4c"
}
},
{
Expand Down
12 changes: 6 additions & 6 deletions Pearcleaner/Logic/AppPathsFetch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ class AppPathFinder {
private var appState: AppState
private var locations: Locations
private var backgroundRun: Bool
private var reverseAddon: Bool
// private var reverseAddon: Bool
private var undo: Bool
private var completion: () -> Void = {}
private var collection: [URL] = []
private let collectionAccessQueue = DispatchQueue(label: "com.alienator88.Pearcleaner.appPathFinder.collectionAccess")

init(appInfo: AppInfo = .empty, appState: AppState, locations: Locations, backgroundRun: Bool = false, reverseAddon: Bool = false, undo: Bool = false, completion: @escaping () -> Void = {}) {
init(appInfo: AppInfo = .empty, appState: AppState, locations: Locations, backgroundRun: Bool = false, undo: Bool = false, completion: @escaping () -> Void = {}) {
self.appInfo = appInfo
self.appState = appState
self.locations = locations
self.backgroundRun = backgroundRun
self.reverseAddon = reverseAddon
// self.reverseAddon = reverseAddon
self.undo = undo
self.completion = completion
}
Expand Down Expand Up @@ -338,9 +338,9 @@ class AppPathFinder {
}

// Append object to store if running reverse search with empty store
if self.reverseAddon {
self.appState.appInfoStore.append(self.appInfo)
}
// if self.reverseAddon {
// self.appState.appInfoStore.append(self.appInfo)
// }

self.completion()
}
Expand Down
14 changes: 13 additions & 1 deletion Pearcleaner/Logic/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let home = FileManager.default.homeDirectoryForCurrentUser.path

class AppState: ObservableObject {
@Published var appInfo: AppInfo
@Published var appInfoStore: [AppInfo] = []
// @Published var appInfoStore: [AppInfo] = []
@Published var trashedFiles: [AppInfo] = []
@Published var zombieFile: ZombieFile
@Published var sortedApps: [AppInfo] = []
Expand All @@ -23,12 +23,24 @@ class AppState: ObservableObject {
@Published var sidebar: Bool = true
@Published var reload: Bool = false
@Published var showProgress: Bool = false
@Published var leftoverProgress: (String, Double) = ("", 0.0)
@Published var finderExtensionEnabled: Bool = false
@Published var showUninstallAlert: Bool = false
@Published var oneShotMode: Bool = false
@Published var showConditionBuilder: Bool = false

var operationQueueLeftover = OperationQueue()
@Published var shouldCancelOperations = false

func cancelQueueOperations() {
operationQueueLeftover.cancelAllOperations()
shouldCancelOperations = true
DispatchQueue.main.async {
self.leftoverProgress = ("Search canceled", 0.0)
self.showProgress = false
self.currentView = .empty
}
}

init() {
self.appInfo = AppInfo(
Expand Down
38 changes: 25 additions & 13 deletions Pearcleaner/Logic/Conditions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,53 +52,62 @@ var conditions: [Condition] = [
Condition(
bundle_id: "com.robotsandpencils.xcodesapp",
include: [],
exclude: ["com.apple.dt.xcode", "com.oneminutegames.xcodecleaner", "io.hyperapp.xcodecleaner"]
exclude: ["com.apple.dt.xcode", "com.oneminutegames.xcodecleaner", "io.hyperapp.xcodecleaner"],
includeForce: nil
),
Condition(
bundle_id: "io.hyperapp.xcodecleaner",
include: [],
exclude: ["com.robotsandpencils.xcodesapp", "com.oneminutegames.xcodecleaner", "com.apple.dt.xcode", "xcodes.json"]
exclude: ["com.robotsandpencils.xcodesapp", "com.oneminutegames.xcodecleaner", "com.apple.dt.xcode", "xcodes.json"],
includeForce: nil
),
Condition(
bundle_id: "us.zoom.xos",
include: ["zoom"],
exclude: []
exclude: [],
includeForce: nil
),
Condition(
bundle_id: "com.brave.browser",
include: ["brave"],
exclude: []
exclude: [],
includeForce: nil
),
Condition(
bundle_id: "com.okta.mobile",
include: ["okta"],
exclude: []
exclude: [],
includeForce: nil
),
Condition(
bundle_id: "com.google.chrome",
include: ["google", "chrome"],
exclude: ["iterm", "chromefeaturestate"]
exclude: ["iterm", "chromefeaturestate"],
includeForce: nil
),
Condition(
bundle_id: "com.microsoft.edgemac",
include: ["microsoft"],
exclude: ["vscode", "rdc", "appcenter", "office", "oneauth"]
exclude: ["vscode", "rdc", "appcenter", "office", "oneauth"],
includeForce: nil
),
Condition(
bundle_id: "org.mozilla.firefox",
include: ["mozilla", "firefox"],
exclude: []
exclude: [],
includeForce: nil
),
Condition(
bundle_id: "org.mozilla.firefox.nightly",
include: ["mozilla", "firefox"],
exclude: []
exclude: [],
includeForce: nil
),
Condition(
bundle_id: "com.logi.optionsplus",
include: ["logi"],
exclude: ["login", "logic"],
includeForce: []
includeForce: nil
),
Condition(
bundle_id: "com.microsoft.vscode",
Expand All @@ -109,17 +118,20 @@ var conditions: [Condition] = [
Condition(
bundle_id: "com.facebook.archon.developerid",
include: ["archon.loginhelper"],
exclude: []
exclude: [],
includeForce: nil
),
Condition(
bundle_id: "eu.exelban.stats",
include: [],
exclude: ["video"]
exclude: ["video"],
includeForce: nil
),
Condition(
bundle_id: "jetbrains",
include: ["jetbrains", "jcef"],
exclude: []
exclude: [],
includeForce: nil
),
]

Expand Down
Loading

0 comments on commit e0d41e7

Please sign in to comment.