feat(prune): R3 guarded deletion — confirm-to-delete + panel button
Extend BANK_PRUNE_FOLDER from report-only to dry-run→confirm-with-manifest→ delete exactly the pure-core orphan set (fresh recompute, stale entries skipped). Windows routes to Recycle Bin (SHFileOperation+FOF_ALLOWUNDO), else unlink. New pure prune_button module + footer button dispatching the action id. No ext-state write, no undo point (deletion is not REAPER-undoable).
This commit is contained in:
@@ -52,4 +52,21 @@ PruneReport buildPruneReport(
|
||||
return report;
|
||||
}
|
||||
|
||||
std::vector<std::string> pruneDeletePlan(const std::vector<std::string>& confirmed,
|
||||
const std::vector<std::string>& freshOrphans) {
|
||||
// fresh is a pure-core output (referenced/hand-dropped already excluded), so keeping a
|
||||
// confirmed path iff it is still a fresh orphan can never re-admit an unsafe file. Walk
|
||||
// `confirmed` to preserve the confirm's listing order; emitted de-dups repeats.
|
||||
const std::unordered_set<std::string> freshSet(freshOrphans.begin(), freshOrphans.end());
|
||||
|
||||
std::vector<std::string> plan;
|
||||
std::unordered_set<std::string> emitted;
|
||||
for (const std::string& path : confirmed) {
|
||||
if (freshSet.count(path) == 0) continue; // stale: vanished / now-referenced -> skip
|
||||
if (!emitted.insert(path).second) continue; // already emitted
|
||||
plan.push_back(path);
|
||||
}
|
||||
return plan;
|
||||
}
|
||||
|
||||
} // namespace reasampler
|
||||
|
||||
Reference in New Issue
Block a user