mirror of
https://github.com/exituser/Pearcleaner.git
synced 2026-09-17 06:09:01 +00:00
Updates
This commit is contained in:
@@ -79,13 +79,13 @@
|
|||||||
</AnalyzeAction>
|
</AnalyzeAction>
|
||||||
<ArchiveAction
|
<ArchiveAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Release"
|
||||||
revealArchiveInOrganizer = "NO">
|
revealArchiveInOrganizer = "YES">
|
||||||
<PostActions>
|
<PostActions>
|
||||||
<ExecutionAction
|
<ExecutionAction
|
||||||
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
|
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
|
||||||
<ActionContent
|
<ActionContent
|
||||||
title = "Run Script"
|
title = "Run Script"
|
||||||
scriptText = "/Users/alin/Projects/Bash/xcode-release.sh Work:false Project:"/Users/alin/GitHub/PearcleanerGH" Name:"Pearcleaner" Log:true "
|
scriptText = "#/Users/alin/Projects/Bash/xcode-release.sh Work:false Project:"/Users/alin/GitHub/PearcleanerGH" Name:"Pearcleaner" Log:true "
|
||||||
shellToInvoke = "/bin/sh">
|
shellToInvoke = "/bin/sh">
|
||||||
<EnvironmentBuildable>
|
<EnvironmentBuildable>
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ let home = FileManager.default.homeDirectoryForCurrentUser.path
|
|||||||
|
|
||||||
class AppState: ObservableObject {
|
class AppState: ObservableObject {
|
||||||
@Published var appInfo: AppInfo
|
@Published var appInfo: AppInfo
|
||||||
// @Published var appInfoStore: [AppInfo] = []
|
|
||||||
@Published var trashedFiles: [AppInfo] = []
|
@Published var trashedFiles: [AppInfo] = []
|
||||||
@Published var zombieFile: ZombieFile
|
@Published var zombieFile: ZombieFile
|
||||||
@Published var sortedApps: [AppInfo] = []
|
@Published var sortedApps: [AppInfo] = []
|
||||||
@@ -166,28 +165,6 @@ struct ZombieFile: Identifiable, Equatable, Hashable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//extension ZombieFile {
|
|
||||||
// func toItems() -> [Item] {
|
|
||||||
// var items: [Item] = []
|
|
||||||
//
|
|
||||||
// for (url, size) in self.fileSize {
|
|
||||||
// let name = url.lastPathComponent
|
|
||||||
// let isDirectory = url.hasDirectoryPath
|
|
||||||
//
|
|
||||||
// let item = Item(
|
|
||||||
// url: url,
|
|
||||||
// name: name,
|
|
||||||
// size: size,
|
|
||||||
// isDirectory: isDirectory
|
|
||||||
// )
|
|
||||||
//
|
|
||||||
// items.append(item)
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return items
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
enum Arch {
|
enum Arch {
|
||||||
case arm
|
case arm
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class Locations: ObservableObject {
|
|||||||
"\(home)/Library/LaunchAgents",
|
"\(home)/Library/LaunchAgents",
|
||||||
"\(home)/Library/Logs",
|
"\(home)/Library/Logs",
|
||||||
"\(home)/Library/Preferences",
|
"\(home)/Library/Preferences",
|
||||||
|
"\(home)/Library/PreferencePanes",
|
||||||
"\(home)/Library/Preferences/ByHost",
|
"\(home)/Library/Preferences/ByHost",
|
||||||
"\(home)/Library/Saved Application State",
|
"\(home)/Library/Saved Application State",
|
||||||
"\(home)/Library/Services",
|
"\(home)/Library/Services",
|
||||||
@@ -88,6 +89,7 @@ class Locations: ObservableObject {
|
|||||||
"\(home)/Library/LaunchAgents",
|
"\(home)/Library/LaunchAgents",
|
||||||
"\(home)/Library/Logs",
|
"\(home)/Library/Logs",
|
||||||
"\(home)/Library/Preferences",
|
"\(home)/Library/Preferences",
|
||||||
|
"\(home)/Library/PreferencePanes",
|
||||||
"\(home)/Library/Preferences/ByHost",
|
"\(home)/Library/Preferences/ByHost",
|
||||||
"\(home)/Library/Saved Application State",
|
"\(home)/Library/Saved Application State",
|
||||||
"\(home)/Library/WebKit",
|
"\(home)/Library/WebKit",
|
||||||
|
|||||||
@@ -155,14 +155,15 @@ struct AppListItems: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
DispatchQueue.global(qos: .userInitiated).async {
|
if self.bundleSize == 0 {
|
||||||
let size = totalSizeOnDisk(for: appInfo.path).logical
|
DispatchQueue.global(qos: .userInitiated).async {
|
||||||
DispatchQueue.main.async {
|
let size = totalSizeOnDisk(for: appInfo.path).logical
|
||||||
self.bundleSize = size
|
DispatchQueue.main.async {
|
||||||
|
self.bundleSize = size
|
||||||
// Optionally, update the appInfo in the appState array
|
// Update the appInfo in the appState array
|
||||||
if let index = appState.sortedApps.firstIndex(where: { $0.path == appInfo.path }) {
|
if let index = appState.sortedApps.firstIndex(where: { $0.path == appInfo.path }) {
|
||||||
appState.sortedApps[index].bundleSize = size
|
appState.sortedApps[index].bundleSize = size
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user