mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 22:33:34 -07:00
fix: setTags compilation err
This commit is contained in:
parent
d72507d326
commit
b63f57435c
1 changed files with 5 additions and 4 deletions
|
@ -1482,15 +1482,16 @@ void TorrentsController::setTagsAction()
|
||||||
const QStringList hashes {params()[u"hashes"_s].split(u'|', Qt::SkipEmptyParts)};
|
const QStringList hashes {params()[u"hashes"_s].split(u'|', Qt::SkipEmptyParts)};
|
||||||
const QStringList tags {params()[u"tags"_s].split(u',', Qt::SkipEmptyParts)};
|
const QStringList tags {params()[u"tags"_s].split(u',', Qt::SkipEmptyParts)};
|
||||||
|
|
||||||
TagSet newTags {tags.begin(), tags.end()};
|
const TagSet newTags {tags.begin(), tags.end()};
|
||||||
applyToTorrents(hashes, [newTags](BitTorrent::Torrent *const torrent)
|
applyToTorrents(hashes, [&newTags](BitTorrent::Torrent *const torrent)
|
||||||
{
|
{
|
||||||
|
TagSet tmpTags {newTags};
|
||||||
for (const Tag &tag : asConst(torrent->tags()))
|
for (const Tag &tag : asConst(torrent->tags()))
|
||||||
{
|
{
|
||||||
if (newTags.erase(tag) == 0)
|
if (tmpTags.erase(tag) == 0)
|
||||||
torrent->removeTag(tag);
|
torrent->removeTag(tag);
|
||||||
}
|
}
|
||||||
for (const Tag &tag : newTags)
|
for (const Tag &tag : tmpTags)
|
||||||
torrent->addTag(tag);
|
torrent->addTag(tag);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue