mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 21:14:33 +00:00
Don't cause QHash relayout while using reference to its node
This commit is contained in:
parent
9b31496b22
commit
1a9e97ee3b
@ -823,21 +823,24 @@ 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())
|
|
||||||
localId = article.value(Article::KeyTorrentURL);
|
|
||||||
if (localId.toString().isEmpty())
|
|
||||||
localId = article.value(Article::KeyTitle);
|
|
||||||
|
|
||||||
if (localId.toString().isEmpty())
|
if (localId.toString().isEmpty())
|
||||||
{
|
{
|
||||||
// The article could not be uniquely identified
|
localId = article.value(Article::KeyTorrentURL);
|
||||||
// since it has no appropriate data.
|
if (localId.toString().isEmpty())
|
||||||
// Just ignore it.
|
{
|
||||||
return;
|
localId = article.value(Article::KeyTitle);
|
||||||
|
if (localId.toString().isEmpty())
|
||||||
|
{
|
||||||
|
// The article could not be uniquely identified
|
||||||
|
// since it has no appropriate data.
|
||||||
|
// Just ignore it.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_articleIDs.contains(localId.toString()))
|
if (m_articleIDs.contains(localId.toString()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user