From: Carl Hetherington Date: Wed, 17 Aug 2022 14:28:57 +0000 (+0200) Subject: Sort DKDMs by CPL name (#2297). X-Git-Tag: v2.16.22~15 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=50bfbd85db2cd237060c304d269fabd9db551161 Sort DKDMs by CPL name (#2297). --- diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index c816c8e8b..62955142a 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -526,11 +526,13 @@ private: } else { /* Add base to the view */ wxTreeItemId added; + auto parent_id = dkdm_to_id(base->parent()); if (previous) { - added = _dkdm->InsertItem(dkdm_to_id(base->parent()), *previous, std_to_wx(base->name())); + added = _dkdm->InsertItem(parent_id, *previous, std_to_wx(base->name())); } else { - added = _dkdm->AppendItem(dkdm_to_id(base->parent()), std_to_wx(base->name())); + added = _dkdm->AppendItem(parent_id, std_to_wx(base->name())); } + _dkdm->SortChildren(parent_id); _dkdm_id[added] = base; }