mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-04 14:42:29 -06:00
committed by
GitHub
parent
f27f2c20e0
commit
10ee1ab7a2
@@ -898,7 +898,7 @@ void AddNewTorrentDialog::setMetadataProgressIndicator(bool visibleIndicator, co
|
||||
void AddNewTorrentDialog::setupTreeview()
|
||||
{
|
||||
Q_ASSERT(hasMetadata());
|
||||
if (Q_UNLIKELY(!hasMetadata()))
|
||||
if (!hasMetadata()) [[unlikely]]
|
||||
return;
|
||||
|
||||
// Set dialog title
|
||||
|
||||
@@ -434,7 +434,7 @@ void RSSWidget::editSelectedRSSFeedURL()
|
||||
QTreeWidgetItem *item = selectedItems.first();
|
||||
RSS::Feed *rssFeed = qobject_cast<RSS::Feed *>(m_feedListWidget->getRSSItem(item));
|
||||
Q_ASSERT(rssFeed);
|
||||
if (Q_UNLIKELY(!rssFeed))
|
||||
if (!rssFeed) [[unlikely]]
|
||||
return;
|
||||
|
||||
bool ok = false;
|
||||
|
||||
@@ -212,7 +212,7 @@ void TorrentContentModel::updateFilesProgress()
|
||||
const QVector<qreal> &filesProgress = m_contentHandler->filesProgress();
|
||||
Q_ASSERT(m_filesIndex.size() == filesProgress.size());
|
||||
// XXX: Why is this necessary?
|
||||
if (Q_UNLIKELY(m_filesIndex.size() != filesProgress.size()))
|
||||
if (m_filesIndex.size() != filesProgress.size()) [[unlikely]]
|
||||
return;
|
||||
|
||||
for (int i = 0; i < filesProgress.size(); ++i)
|
||||
@@ -248,7 +248,7 @@ void TorrentContentModel::updateFilesAvailability()
|
||||
|
||||
Q_ASSERT(m_filesIndex.size() == availableFileFractions.size());
|
||||
// XXX: Why is this necessary?
|
||||
if (Q_UNLIKELY(m_filesIndex.size() != availableFileFractions.size()))
|
||||
if (m_filesIndex.size() != availableFileFractions.size()) [[unlikely]]
|
||||
return;
|
||||
|
||||
for (int i = 0; i < m_filesIndex.size(); ++i)
|
||||
|
||||
@@ -454,7 +454,7 @@ void TorrentContentWidget::onItemDoubleClicked(const QModelIndex &index)
|
||||
const auto *contentHandler = m_model->contentHandler();
|
||||
Q_ASSERT(contentHandler && contentHandler->hasMetadata());
|
||||
|
||||
if (Q_UNLIKELY(!contentHandler || !contentHandler->hasMetadata()))
|
||||
if (!contentHandler || !contentHandler->hasMetadata()) [[unlikely]]
|
||||
return;
|
||||
|
||||
if (m_doubleClickAction == DoubleClickAction::Rename)
|
||||
|
||||
@@ -392,7 +392,7 @@ void TrackersFilterWidget::handleFavicoDownloadFinished(const Net::DownloadResul
|
||||
{
|
||||
const QSet<QString> trackerHosts = m_downloadingFavicons.take(result.url);
|
||||
Q_ASSERT(!trackerHosts.isEmpty());
|
||||
if (Q_UNLIKELY(trackerHosts.isEmpty()))
|
||||
if (trackerHosts.isEmpty()) [[unlikely]]
|
||||
return;
|
||||
|
||||
QIcon icon;
|
||||
@@ -439,7 +439,7 @@ void TrackersFilterWidget::handleFavicoDownloadFinished(const Net::DownloadResul
|
||||
|
||||
QListWidgetItem *trackerItem = item(rowFromTracker(trackerHost));
|
||||
Q_ASSERT(trackerItem);
|
||||
if (Q_UNLIKELY(!trackerItem))
|
||||
if (!trackerItem) [[unlikely]]
|
||||
continue;
|
||||
|
||||
trackerItem->setData(Qt::DecorationRole, icon);
|
||||
|
||||
Reference in New Issue
Block a user