mirror of
https://github.com/exituser/Pearcleaner.git
synced 2026-09-17 10:48:52 +00:00
v3.9.1
This commit is contained in:
@@ -14,7 +14,8 @@ import AlinFoundation
|
||||
class MetadataAppInfoFetcher {
|
||||
static func getAppInfo(fromMetadata metadata: [String: Any], atPath path: URL) -> AppInfo? {
|
||||
// Extract metadata attributes for known fields
|
||||
let displayName = metadata["kMDItemDisplayName"] as? String ?? ""
|
||||
var displayName = metadata["kMDItemDisplayName"] as? String ?? ""
|
||||
displayName = displayName.replacingOccurrences(of: ".app", with: "").capitalizingFirstLetter()
|
||||
let fsName = metadata["kMDItemFSName"] as? String ?? path.lastPathComponent
|
||||
let appName = displayName.isEmpty ? fsName : displayName
|
||||
|
||||
@@ -152,7 +153,7 @@ class AppInfoUtils {
|
||||
static func fetchAppIcon(for path: URL, wrapped: Bool, md: Bool = false) -> NSImage? {
|
||||
let iconPath = wrapped ? (md ? path : path.deletingLastPathComponent().deletingLastPathComponent()) : path
|
||||
if let appIcon = getIconForFileOrFolderNS(atPath: iconPath) {
|
||||
return convertICNSToPNG(icon: appIcon, size: NSSize(width: 100, height: 100))
|
||||
return convertICNSToPNG(icon: appIcon, size: NSSize(width: 50, height: 50))
|
||||
} else {
|
||||
printOS("App Icon not found for app at path: \(path)")
|
||||
return nil
|
||||
|
||||
@@ -208,6 +208,21 @@ enum CurrentPage:Int, CaseIterable, Identifiable
|
||||
}
|
||||
}
|
||||
|
||||
enum SortOption:Int, CaseIterable, Identifiable {
|
||||
case alphabetical
|
||||
case size
|
||||
case creationDate
|
||||
case contentChangeDate
|
||||
case lastUsedDate
|
||||
|
||||
var id: Int { rawValue }
|
||||
|
||||
var title: String {
|
||||
let titles: [String] = ["App Name", "App Size", "Install Date", "Modified Date", "Last Used Date"]
|
||||
return titles[rawValue]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum CurrentTabView:Int
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user