mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
Fix crash when removing phantom tags
Normally a tag is stored in both session and torrent's fastresume. A phantom tag is a tag that is stored in fastresume but not in session. This crash can occur when user resets his config file and choose to remove tag from torrent. Closes #10569.
This commit is contained in:
parent
ac9ba255d8
commit
d03209a73d
1 changed files with 5 additions and 5 deletions
|
@ -216,15 +216,15 @@ void TagFilterModel::torrentTagAdded(BitTorrent::TorrentHandle *const torrent, c
|
|||
|
||||
void TagFilterModel::torrentTagRemoved(BitTorrent::TorrentHandle *const torrent, const QString &tag)
|
||||
{
|
||||
Q_ASSERT(torrent->tags().count() >= 0);
|
||||
if (torrent->tags().count() == 0)
|
||||
if (torrent->tags().empty())
|
||||
untaggedItem()->increaseTorrentsCount();
|
||||
|
||||
const int row = findRow(tag);
|
||||
Q_ASSERT(isValidRow(row));
|
||||
TagModelItem &item = m_tagItems[row];
|
||||
if (row < 0)
|
||||
return;
|
||||
|
||||
m_tagItems[row].decreaseTorrentsCount();
|
||||
|
||||
item.decreaseTorrentsCount();
|
||||
const QModelIndex i = index(row, 0, QModelIndex());
|
||||
emit dataChanged(i, i);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue