Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Tell an Intel plug-in's formats apart on Intel Software

Țugui Dragoș3d617f482c87
diff --git a/Peel/Model/IntelLibrary.swift b/Peel/Model/IntelLibrary.swift
index 8e57861d..8d660ce9 100644
--- a/Peel/Model/IntelLibrary.swift
+++ b/Peel/Model/IntelLibrary.swift
@@ -98,6 +98,12 @@ extension IntelFinding {
}
}
+ /// What the row says under the name: what the finding belongs to, or a plug-in's format, since one plug-in is
+ /// often installed in several formats under one name.
+ var subtitle: LocalizedStringResource? {
+ owner.map { "in \($0)" } ?? pluginCategory?.title
+ }
+
/// Whether an app that loads the plug-in decides whether it loads, as for a plug-in loaded inside the app.
var loadsThroughAnApp: Bool {
kind == .plugin && [.insideTheApp, .outsideTheAppWhenAsked].contains(pluginCategory?.intelHost)
diff --git a/Peel/Views/Intel/IntelDetailView.swift b/Peel/Views/Intel/IntelDetailView.swift
index 16770533..a7fa37f2 100644
--- a/Peel/Views/Intel/IntelDetailView.swift
+++ b/Peel/Views/Intel/IntelDetailView.swift
@@ -174,7 +174,10 @@ struct IntelDetailView: View {
name: String(localized: "Intel only"),
detail: Text("Built for Intel processors only. On Apple silicon it needs Rosetta.")
)
- Badge(title: Text(finding.kind.title), systemImage: finding.kind.systemImage)
+ Badge(
+ title: Text(finding.pluginCategory?.title ?? finding.kind.title),
+ systemImage: finding.kind.systemImage
+ )
}
.padding(.top, 2)
}
diff --git a/Peel/Views/Intel/IntelList.swift b/Peel/Views/Intel/IntelList.swift
index 8ea50e29..1f97fcff 100644
--- a/Peel/Views/Intel/IntelList.swift
+++ b/Peel/Views/Intel/IntelList.swift
@@ -155,8 +155,8 @@ private struct IntelRow: View {
Text(verbatim: finding.name)
.lineLimit(1)
.truncationMode(.middle)
- if let owner = finding.owner {
- Text("in \(owner)")
+ if let subtitle = finding.subtitle {
+ Text(subtitle)
.font(.caption)
.foregroundStyle(.secondary)
.lineLimit(1)
diff --git a/PeelTests/IntelExplanationTests.swift b/PeelTests/IntelExplanationTests.swift
index e47e13cc..e466fb75 100644
--- a/PeelTests/IntelExplanationTests.swift
+++ b/PeelTests/IntelExplanationTests.swift
@@ -22,6 +22,13 @@ struct IntelExplanationTests {
#expect(String(localized: plugin(.vst3).explanation(onAppleSilicon: false)) == String(localized: "This plug-in is Intel only. On this Intel Mac it loads natively."))
}
+ @Test func tellsAPlugInsFormatsApart() {
+ let words = { (finding: IntelFinding) in finding.subtitle.map { String(localized: $0) } }
+
+ #expect(words(plugin(.vst3)) == String(localized: "VST3 Plug-ins"))
+ #expect(words(plugin(.audioUnits)) == String(localized: "Audio Units"))
+ }
+
@Test func givesApplesCommandWhereNothingOpensToOfferRosetta() {
#expect(IntelFinding.Kind.allCases.filter(\.offersRosettaWhenOpened) == [.app])
#expect(Rosetta.installCommand == "softwareupdate --install-rosetta")