Replace QModelIndex child() with index()
This commit is contained in:
@@ -290,10 +290,9 @@ void InternetSearchModel::GetChildResults(const QStandardItem *item, InternetSea
|
|||||||
if (item->rowCount()) {
|
if (item->rowCount()) {
|
||||||
const QModelIndex parent_proxy_index = proxy_->mapFromSource(item->index());
|
const QModelIndex parent_proxy_index = proxy_->mapFromSource(item->index());
|
||||||
|
|
||||||
// Yes - visit all the children, but do so through the proxy so we get them
|
// Yes - visit all the children, but do so through the proxy so we get them in the right order.
|
||||||
// in the right order.
|
|
||||||
for (int i = 0; i < item->rowCount(); ++i) {
|
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);
|
const QModelIndex index = proxy_->mapToSource(proxy_index);
|
||||||
GetChildResults(itemFromIndex(index), results, visited);
|
GetChildResults(itemFromIndex(index), results, visited);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ void PlaylistListContainer::RecursivelyFindPlaylists(const QModelIndex &parent,
|
|||||||
|
|
||||||
case PlaylistListModel::Type_Folder:
|
case PlaylistListModel::Type_Folder:
|
||||||
for (int i = 0; i < parent.model()->rowCount(parent); ++i) {
|
for (int i = 0; i < parent.model()->rowCount(parent); ++i) {
|
||||||
RecursivelyFindPlaylists(parent.child(i, 0), ids);
|
RecursivelyFindPlaylists(proxy_->index(i, 0, parent), ids);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user