mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 09:13:08 -07:00
Correctly handle model resetting
This commit is contained in:
parent
0f82c16936
commit
c636618cf3
1 changed files with 4 additions and 2 deletions
|
@ -519,7 +519,8 @@ void TorrentContentModel::setupModelData(const BitTorrent::AbstractFileStorage &
|
||||||
if (filesCount <= 0)
|
if (filesCount <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
emit layoutAboutToBeChanged();
|
beginResetModel();
|
||||||
|
|
||||||
// Initialize files_index array
|
// Initialize files_index array
|
||||||
qDebug("Torrent contains %d files", filesCount);
|
qDebug("Torrent contains %d files", filesCount);
|
||||||
m_filesIndex.reserve(filesCount);
|
m_filesIndex.reserve(filesCount);
|
||||||
|
@ -566,5 +567,6 @@ void TorrentContentModel::setupModelData(const BitTorrent::AbstractFileStorage &
|
||||||
lastParent->appendChild(fileItem);
|
lastParent->appendChild(fileItem);
|
||||||
m_filesIndex.push_back(fileItem);
|
m_filesIndex.push_back(fileItem);
|
||||||
}
|
}
|
||||||
emit layoutChanged();
|
|
||||||
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue