mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
Merge pull request #14586 from glassez/varhash
Don't cause QHash relayout while using reference to its node
This commit is contained in:
@@ -823,15 +823,16 @@ void Parser::addArticle(QVariantHash article)
|
|||||||
{
|
{
|
||||||
QVariant &torrentURL = article[Article::KeyTorrentURL];
|
QVariant &torrentURL = article[Article::KeyTorrentURL];
|
||||||
if (torrentURL.toString().isEmpty())
|
if (torrentURL.toString().isEmpty())
|
||||||
torrentURL = article[Article::KeyLink];
|
torrentURL = article.value(Article::KeyLink);
|
||||||
|
|
||||||
// If item does not have an ID, fall back to some other identifier.
|
// If item does not have an ID, fall back to some other identifier.
|
||||||
QVariant &localId = article[Article::KeyId];
|
QVariant &localId = article[Article::KeyId];
|
||||||
if (localId.toString().isEmpty())
|
if (localId.toString().isEmpty())
|
||||||
|
{
|
||||||
localId = article.value(Article::KeyTorrentURL);
|
localId = article.value(Article::KeyTorrentURL);
|
||||||
if (localId.toString().isEmpty())
|
if (localId.toString().isEmpty())
|
||||||
|
{
|
||||||
localId = article.value(Article::KeyTitle);
|
localId = article.value(Article::KeyTitle);
|
||||||
|
|
||||||
if (localId.toString().isEmpty())
|
if (localId.toString().isEmpty())
|
||||||
{
|
{
|
||||||
// The article could not be uniquely identified
|
// The article could not be uniquely identified
|
||||||
@@ -839,6 +840,8 @@ void Parser::addArticle(QVariantHash article)
|
|||||||
// Just ignore it.
|
// Just ignore it.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_articleIDs.contains(localId.toString()))
|
if (m_articleIDs.contains(localId.toString()))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user