From 15c5ad33aee4259acdd297bd7de198bd37233787 Mon Sep 17 00:00:00 2001 From: Alin Date: Sat, 13 Jul 2024 17:50:43 -0600 Subject: [PATCH] Small changes --- Pearcleaner/Logic/Conditions.swift | 2 +- Pearcleaner/Logic/Utilities.swift | 9 --------- Pearcleaner/Settings/Interface.swift | 2 +- Pearcleaner/Settings/Update.swift | 2 +- Pearcleaner/Windows/UpdateView.swift | 23 ++++------------------- 5 files changed, 7 insertions(+), 31 deletions(-) diff --git a/Pearcleaner/Logic/Conditions.swift b/Pearcleaner/Logic/Conditions.swift index 4822412..71f4e66 100644 --- a/Pearcleaner/Logic/Conditions.swift +++ b/Pearcleaner/Logic/Conditions.swift @@ -135,7 +135,7 @@ let skipConditions: [SkipCondition] = [ // Skip files/folders during leftover file search -let skipReverse = ["apple", "temporary", "btserver", "proapps", "scripteditor", "ilife", "livefsd", "siritoday", "addressbook", "animoji", "appstore", "askpermission", "callhistory", "clouddocs", "diskimages", "dock", "facetime", "fileprovider", "instruments", "knowledge", "mobilesync", "syncservices", "homeenergyd", "icloud", "icdd", "networkserviceproxy", "familycircle", "geoservices", "installation", "passkit", "sharedimagecache", "desktop", "mbuseragent", "swiftpm", "baseband", "coresimulator", "photoslegacyupgrade", "photosupgrade", "siritts", "ipod", "globalpreferences", "apmanalytics", "apmexperiment", "avatarcache", "byhost", "contextstoreagent", "mobilemeaccounts", "intentbuilderc", "loginwindow", "momc", "replayd", "sharedfilelistd", "clang", "audiocomponent", "csexattrcryptoservice", "livetranscriptionagent", "sandboxhelper", "statuskitagent", "betaenrollmentd", "contentlinkingd", "diagnosticextensionsd", "gamed", "heard", "homed", "itunescloudd", "lldb", "mds", "mediaanalysisd", "metrickitd", "mobiletimerd", "proactived", "ptpcamerad", "studentd", "talagent", "watchlistd", "apptranslocation", "xcrun", "ds_store", "caches", "crashreporter", "trash", "pearcleaner", "amsdatamigratortool", "arfilecache", "assistant", "chromium", "cloudkit", "webkit", "databases", "diagnostic", "cache", "gamekit", "homebrew", "logi", "microsoft", "mozilla", "sync", "google", "sentinel", "hexnode", "sentry", "tvappservices", "reminders"] +let skipReverse = ["apple", "temporary", "btserver", "proapps", "scripteditor", "ilife", "livefsd", "siritoday", "addressbook", "animoji", "appstore", "askpermission", "callhistory", "clouddocs", "diskimages", "dock", "facetime", "fileprovider", "instruments", "knowledge", "mobilesync", "syncservices", "homeenergyd", "icloud", "icdd", "networkserviceproxy", "familycircle", "geoservices", "installation", "passkit", "sharedimagecache", "desktop", "mbuseragent", "swiftpm", "baseband", "coresimulator", "photoslegacyupgrade", "photosupgrade", "siritts", "ipod", "globalpreferences", "apmanalytics", "apmexperiment", "avatarcache", "byhost", "contextstoreagent", "mobilemeaccounts", "mobiledocuments", "mobile", "intentbuilderc", "loginwindow", "momc", "replayd", "sharedfilelistd", "clang", "audiocomponent", "csexattrcryptoservice", "livetranscriptionagent", "sandboxhelper", "statuskitagent", "betaenrollmentd", "contentlinkingd", "diagnosticextensionsd", "gamed", "heard", "homed", "itunescloudd", "lldb", "mds", "mediaanalysisd", "metrickitd", "mobiletimerd", "proactived", "ptpcamerad", "studentd", "talagent", "watchlistd", "apptranslocation", "xcrun", "ds_store", "caches", "crashreporter", "trash", "pearcleaner", "amsdatamigratortool", "arfilecache", "assistant", "chromium", "cloudkit", "webkit", "databases", "diagnostic", "cache", "gamekit", "homebrew", "logi", "microsoft", "mozilla", "sync", "google", "sentinel", "hexnode", "sentry", "tvappservices", "reminders"] diff --git a/Pearcleaner/Logic/Utilities.swift b/Pearcleaner/Logic/Utilities.swift index 9f1a34a..4527ed7 100644 --- a/Pearcleaner/Logic/Utilities.swift +++ b/Pearcleaner/Logic/Utilities.swift @@ -342,14 +342,6 @@ extension NSImage { } } -func startEnd(_ function: @escaping () -> Void) { - let startTime = Date() // Capture start time - function() - let endTime = Date() - let executionTime = endTime.timeIntervalSince(startTime) - printOS("Function executed in: \n\(executionTime) seconds") -} - // Relaunch app func relaunchApp(afterDelay seconds: TimeInterval = 0.5) -> Never { @@ -553,7 +545,6 @@ func printOS(_ items: Any..., separator: String = " ", terminator: String = "\n" let message = items.map { "\($0)" }.joined(separator: separator) let log = OSLog(subsystem: "pearcleaner", category: "Application") os_log("%@", log: log, type: .default, message) - } diff --git a/Pearcleaner/Settings/Interface.swift b/Pearcleaner/Settings/Interface.swift index bd16002..0179e97 100644 --- a/Pearcleaner/Settings/Interface.swift +++ b/Pearcleaner/Settings/Interface.swift @@ -118,7 +118,7 @@ struct InterfaceSettingsTab: View { .font(.callout) .foregroundStyle(Color("mode").opacity(0.5)) } -// InfoButton(text: "When using a custom color, you might need to change the application color mode below to Dark or Light so text is readable") + Spacer() diff --git a/Pearcleaner/Settings/Update.swift b/Pearcleaner/Settings/Update.swift index 3378166..aa4a063 100644 --- a/Pearcleaner/Settings/Update.swift +++ b/Pearcleaner/Settings/Update.swift @@ -35,7 +35,7 @@ struct UpdateSettingsTab: View { } } .onChange(of: updateFrequency) { frequency in - updateFrequency.updateNextUpdateDate() + frequency.updateNextUpdateDate() } .pickerStyle(themeSettings: themeSettings) } diff --git a/Pearcleaner/Windows/UpdateView.swift b/Pearcleaner/Windows/UpdateView.swift index 4de0772..7a99082 100644 --- a/Pearcleaner/Windows/UpdateView.swift +++ b/Pearcleaner/Windows/UpdateView.swift @@ -24,8 +24,7 @@ struct UpdateView: View { .padding() Spacer() -// .frame(width: appState.progressBar.1 != 1.0 ? 150 : 180) - + Text("\(appState.progressBar.1 != 1.0 ? "Update Available 🥳" : "Completed 🚀")") .font(.title) .bold() @@ -105,12 +104,9 @@ struct UpdateView: View { isUserAdmin = result.isAdmin } } - - } - } @@ -128,8 +124,7 @@ struct NoUpdateView: View { .padding() Spacer() -// .frame(width: appState.progressBar.1 != 1.0 ? 140 : 180) - + Text("\(appState.progressBar.1 != 1.0 ? "No Update 😌" : "Completed 🚀")") .font(.title) .bold() @@ -145,12 +140,6 @@ struct NoUpdateView: View { } -// Text("App: \(Bundle.main.version) | GitHub: \(appState.releases.first?.tag_name ?? "")") -// .font(.title3) -// .fontWeight(.semibold) -// .opacity(0.5) -// .padding(.vertical, 5) - Divider() .padding([.horizontal]) @@ -201,15 +190,11 @@ struct NoUpdateView: View { } } .padding(.bottom) - - - + } .padding(EdgeInsets(top: -25, leading: 0, bottom: 25, trailing: 0)) - - + } - }