1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-28 16:20:26 +01:00

Replace QModelIndex child() with index()

This commit is contained in:
Jonas Kvinge 2019-07-08 22:23:15 +02:00
parent cc3d454d60
commit beeba88ea5
2 changed files with 3 additions and 4 deletions

View File

@ -290,10 +290,9 @@ void InternetSearchModel::GetChildResults(const QStandardItem *item, InternetSea
if (item->rowCount()) {
const QModelIndex parent_proxy_index = proxy_->mapFromSource(item->index());
// Yes - visit all the children, but do so through the proxy so we get them
// in the right order.
// Yes - visit all the children, but do so through the proxy so we get them in the right order.
for (int i = 0; i < item->rowCount(); ++i) {
const QModelIndex proxy_index = parent_proxy_index.child(i, 0);
const QModelIndex proxy_index = index(i, 0, parent_proxy_index);
const QModelIndex index = proxy_->mapToSource(proxy_index);
GetChildResults(itemFromIndex(index), results, visited);
}

View File

@ -371,7 +371,7 @@ void PlaylistListContainer::RecursivelyFindPlaylists(const QModelIndex &parent,
case PlaylistListModel::Type_Folder:
for (int i = 0; i < parent.model()->rowCount(parent); ++i) {
RecursivelyFindPlaylists(parent.child(i, 0), ids);
RecursivelyFindPlaylists(proxy_->index(i, 0, parent), ids);
}
break;
}