* swift fix

* fix

* fix again
This commit is contained in:
Brendan Allan
2023-06-22 17:27:28 +02:00
committed by GitHub
parent 6e9181bb77
commit fb0beafa8d

View File

@@ -30,15 +30,17 @@ func getOpenWithApplications(urlString: SRString) -> SRObjectArray {
.compactMap { url in
Bundle(url: url)?.infoDictionary.map { ($0, url) }
}
.compactMap { (dict, url) in
let name = SRString((dict["CFBundleDisplayName"] ?? dict["CFBundleName"]) as! String);
.compactMap { (dict, url) -> NSObject? in
guard let name = (dict["CFBundleDisplayName"] ?? dict["CFBundleName"]) as? String else {
return nil
};
if !url.path.contains("/Applications/") {
return nil
}
return OpenWithApplication(
name: name,
name: SRString(name),
id: SRString(dict["CFBundleIdentifier"] as! String),
url: SRString(url.path)
)