diff options
Diffstat (limited to 'src/library/cratefeature.cpp')
-rw-r--r-- | src/library/cratefeature.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/cratefeature.cpp b/src/library/cratefeature.cpp index d82043ceb0..49c4560b8e 100644 --- a/src/library/cratefeature.cpp +++ b/src/library/cratefeature.cpp @@ -94,8 +94,8 @@ CrateFeature::CrateFeature(Library* pLibrary, this, SLOT(slotCrateTableChanged(int))); // construct child model - TreeItem *rootItem = new TreeItem(this); - m_childModel.setRootItem(rootItem); + auto pRootItem = std::make_unique<TreeItem>(this); + m_childModel.setRootItem(std::move(pRootItem)); constructChildModel(-1); connect(pLibrary, SIGNAL(trackSelected(TrackPointer)), @@ -823,7 +823,7 @@ void CrateFeature::slotTrackSelected(TrackPointer pTrack) { TrackId trackId(pTrack ? pTrack->getId() : TrackId()); m_crateDao.getCratesTrackIsIn(trackId, &m_cratesSelectedTrackIsIn); - TreeItem* rootItem = m_childModel.getItem(QModelIndex()); + TreeItem* rootItem = m_childModel.getRootItem(); if (rootItem == nullptr) { return; } |