summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-10-20 21:22:17 +0200
committerCarl Hetherington <cth@carlh.net>2026-02-03 21:37:04 +0100
commiteda0b0b0ffecf2d6d67407303a1bd45659ccdfce (patch)
treec57cda863071ca7af8de20ac9bce128b45d93289 /src/wx
parent9b841fddd3aa4a1117b03299bce964c5e4b205d9 (diff)
Replace find_and_resolve_cpls() with storing all CPL IDs in DCPContent (sometimes).
In some places we need other details than the ID, but in lots of places this saves some disk searching.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/content_menu.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index b75c29660..527e28624 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -454,8 +454,8 @@ ContentMenu::kdm()
return;
}
- auto cpls = dcp::find_and_resolve_cpls(dcp->directories(), true);
- bool const kdm_matches_any_cpl = std::any_of(cpls.begin(), cpls.end(), [kdm](shared_ptr<const dcp::CPL> cpl) { return cpl->id() == kdm->cpl_id(); });
+ auto cpls = dcp->cpls();
+ bool const kdm_matches_any_cpl = std::any_of(cpls.begin(), cpls.end(), [kdm](std::string const& cpl) { return cpl == kdm->cpl_id(); });
bool const kdm_matches_selected_cpl = dcp->cpl() || kdm->cpl_id() == dcp->cpl().get();
if (!kdm_matches_any_cpl) {
@@ -549,11 +549,11 @@ ContentMenu::cpl_selected(wxCommandEvent& ev)
auto dcp = dynamic_pointer_cast<DCPContent>(_content.front());
DCPOMATIC_ASSERT(dcp);
- auto cpls = dcp::find_and_resolve_cpls(dcp->directories(), true);
+ auto cpls = dcp->cpls();
DCPOMATIC_ASSERT(ev.GetId() >= DCPOMATIC_CPL_MENU);
DCPOMATIC_ASSERT(ev.GetId() < int(DCPOMATIC_CPL_MENU + cpls.size()));
- dcp->set_cpl(cpls[ev.GetId() - DCPOMATIC_CPL_MENU]->id());
+ dcp->set_cpl(cpls[ev.GetId() - DCPOMATIC_CPL_MENU]);
auto film = _film.lock();
DCPOMATIC_ASSERT(film);