diff --git a/Pearcleaner.xcodeproj/project.pbxproj b/Pearcleaner.xcodeproj/project.pbxproj index 22a5616..803c96d 100644 --- a/Pearcleaner.xcodeproj/project.pbxproj +++ b/Pearcleaner.xcodeproj/project.pbxproj @@ -539,7 +539,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BK8443AXLU; @@ -557,7 +557,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 2.0; + MARKETING_VERSION = 2.1; PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -574,7 +574,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BK8443AXLU; @@ -592,7 +592,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 2.0; + MARKETING_VERSION = 2.1; PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/Pearcleaner/Logic/Logic.swift b/Pearcleaner/Logic/Logic.swift index fbfd1c6..e1ffdf0 100644 --- a/Pearcleaner/Logic/Logic.swift +++ b/Pearcleaner/Logic/Logic.swift @@ -125,11 +125,23 @@ func getAppInfo(atPath path: URL) -> AppInfo? { return AppInfo(id: UUID(), path: path, bundleIdentifier: bundleIdentifier, appName: appName ?? "", appVersion: appVersion, appIcon: appIcon, webApp: webApp ?? false, wrapped: false) } else { -// print("One or more variables missing for app at path: \(path)") - let wrapperURL = path.appendingPathComponent("Wrapper").appendingPathComponent(path.lastPathComponent) - if let wrappedAppInfo = getWrappedAppInfo(atPath: wrapperURL) { - return wrappedAppInfo + let wrapperURL = path.appendingPathComponent("Wrapper")//.appendingPathComponent(path.lastPathComponent) + do { + let contents = try FileManager.default.contentsOfDirectory(at: wrapperURL, includingPropertiesForKeys: nil, options: []) + let appFiles = contents.filter { $0.pathExtension == "app" } + + if let firstAppFile = appFiles.first { + let fullPath = wrapperURL.appendingPathComponent(firstAppFile.lastPathComponent) + if let wrappedAppInfo = getWrappedAppInfo(atPath: fullPath) { + return wrappedAppInfo + } + } else { + print("No .app files found in the 'Wrapper' directory.") + } + } catch { + print("Error reading contents of 'Wrapper' directory: \(error.localizedDescription)") } + } } else { print("Bundle not found at path: \(path)") diff --git a/Pearcleaner/PearcleanerApp.swift b/Pearcleaner/PearcleanerApp.swift index 30d73e1..c50775a 100644 --- a/Pearcleaner/PearcleanerApp.swift +++ b/Pearcleaner/PearcleanerApp.swift @@ -23,15 +23,15 @@ struct PearcleanerApp: App { var body: some Scene { + + WindowGroup { Group { if !mini { AppListView(search: $search, showPopover: $showPopover) - .frame(minWidth: 800, minHeight: 500) } else { MiniMode(search: $search, showPopover: $showPopover) - .frame(minWidth: 300, minHeight: 300) } } @@ -49,22 +49,15 @@ struct PearcleanerApp: App { if let data = data as? Data, let url = URL(dataRepresentation: data, relativeTo: nil) { let deeplinkManager = DeeplinkManager() deeplinkManager.manage(url: url, appState: appState) - // // Check if the file URL has a ".app" extension - // if url.pathExtension.lowercased() == "app" { - // // Handle the dropped file URL here - // print("Dropped .app file URL: \(url)") - // } else { - // // Print a message for non-.app files - // print("Unsupported file type. Only .app files are accepted.") - // } } } } return true } .onAppear { + // Disable tabbing NSWindow.allowsAutomaticWindowTabbing = false - + // Get Apps let sortedApps = getSortedApps() appState.sortedApps.userApps = sortedApps.userApps @@ -112,7 +105,7 @@ struct PearcleanerApp: App { CommandGroup(replacing: .newItem, addition: { }) } - + Settings { SettingsView() @@ -128,7 +121,11 @@ struct PearcleanerApp: App { class AppDelegate: NSObject, NSApplicationDelegate { func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + #if DEBUG return true + #else + return false + #endif } // func application(_ sender: NSApplication, open urls: [URL]) { // for url in urls { diff --git a/Pearcleaner/Settings/General.swift b/Pearcleaner/Settings/General.swift index 2b8b633..c3caf84 100644 --- a/Pearcleaner/Settings/General.swift +++ b/Pearcleaner/Settings/General.swift @@ -97,10 +97,11 @@ struct GeneralSettingsTab: View { }) .toggleStyle(.switch) .onChange(of: mini) { newVal in - resizeWindow(width: 300, height: 300) if mini { + resizeWindow(width: 300, height: 300) appState.currentView = .empty } else { + resizeWindow(width: 700, height: 500) if appState.appInfo.appName.isEmpty { appState.currentView = .empty } else { diff --git a/Pearcleaner/Views/AppListItems.swift b/Pearcleaner/Views/AppListItems.swift index 6cce39d..0a6abc6 100644 --- a/Pearcleaner/Views/AppListItems.swift +++ b/Pearcleaner/Views/AppListItems.swift @@ -30,6 +30,7 @@ struct AppListItems: View { .resizable() .aspectRatio(contentMode: .fit) .frame(width: 30, height: 30) + .clipShape(RoundedRectangle(cornerRadius: 8)) } VStack(alignment: .leading, spacing: 5) { Text(appInfo.appName) diff --git a/Pearcleaner/Views/AppListView.swift b/Pearcleaner/Views/AppListView.swift index 64ccce4..4a3bcf5 100644 --- a/Pearcleaner/Views/AppListView.swift +++ b/Pearcleaner/Views/AppListView.swift @@ -144,6 +144,7 @@ struct AppListView: View { Spacer() } + .frame(minWidth: 700, minHeight: 500) .edgesIgnoringSafeArea(.all) // .onOpenURL(perform: { url in // let deeplinkManager = DeeplinkManager() diff --git a/Pearcleaner/Views/FilesView.swift b/Pearcleaner/Views/FilesView.swift index 826b129..57f7d9d 100644 --- a/Pearcleaner/Views/FilesView.swift +++ b/Pearcleaner/Views/FilesView.swift @@ -41,6 +41,7 @@ struct FilesView: View { .scaledToFit() // .aspectRatio(contentMode: .fit) .frame(width: 50, height: 50) + .clipShape(RoundedRectangle(cornerRadius: 8)) .padding(.leading) } //app title, size and items @@ -310,6 +311,8 @@ struct FileDetailsItem: View { .resizable() .aspectRatio(contentMode: .fit) .frame(width: 30, height: 30) + .clipShape(RoundedRectangle(cornerRadius: 8)) + } VStack(alignment: .leading, spacing: 5) { Text(path.lastPathComponent) diff --git a/Pearcleaner/Views/MiniMode.swift b/Pearcleaner/Views/MiniMode.swift index 0063646..52f64c1 100644 --- a/Pearcleaner/Views/MiniMode.swift +++ b/Pearcleaner/Views/MiniMode.swift @@ -218,7 +218,7 @@ struct MiniAppView: View { .scrollIndicators(.never) } -// .padding(.vertical) + .padding(.bottom) }