Sort DKDMs by CPL name (#2297).
authorCarl Hetherington <cth@carlh.net>
Wed, 17 Aug 2022 14:28:57 +0000 (16:28 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 17 Aug 2022 14:28:57 +0000 (16:28 +0200)
src/tools/dcpomatic_kdm.cc

index c816c8e8b161f8e5a5da47edce370f4f2ed375f3..62955142a7aaf4dd073d77d51c910cffd67bc0b9 100644 (file)
@@ -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;
                }