@@ -33,7 +33,6 @@ MixxxLibraryFeature::MixxxLibraryFeature(Library* pLibrary,
3333 m_pSidebarModel(make_parented<TreeItemModel>(this )),
3434 m_pMissingView(nullptr ),
3535 m_pHiddenView(nullptr ),
36- m_pTracksTreeItem(nullptr ),
3736 m_trackCount{0 } {
3837 QString idColumn = LIBRARYTABLE_ID ;
3938 QStringList columns = {
@@ -122,7 +121,6 @@ MixxxLibraryFeature::MixxxLibraryFeature(Library* pLibrary,
122121 &MixxxLibraryFeature::slotUpdateTrackCount);
123122
124123 std::unique_ptr<TreeItem> pRootItem = TreeItem::newRoot (this );
125- m_pTracksTreeItem = pRootItem.get ();
126124 pRootItem->appendChild (kMissingTitle );
127125 pRootItem->appendChild (kHiddenTitle );
128126
@@ -195,12 +193,9 @@ void MixxxLibraryFeature::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) {
195193void MixxxLibraryFeature::slotUpdateTrackCount () {
196194 m_trackCount = m_pLibraryTableModel->rowCount ();
197195
198- if (m_pTracksTreeItem && m_pSidebarModel) {
199- QModelIndex rootIndex = m_pSidebarModel->getRootIndex ();
200- QModelIndex tracksIndex = m_pSidebarModel->index (
201- m_pTracksTreeItem->parentRow (), 0 , rootIndex);
202- m_pSidebarModel->triggerRepaint (tracksIndex);
203- }
196+ // Force updating the Tracks sidebar item.
197+ // `select` must be false as we don't want to select again
198+ emit featureIsLoading (this , false );
204199}
205200
206201void MixxxLibraryFeature::activate () {
0 commit comments