mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-27 23:14:31 +00:00
Replace a series of if()
by switch()
This commit is contained in:
parent
90308c2ae5
commit
bb73fa5dbe
@ -583,16 +583,18 @@ QString TrackerFiltersList::getHost(const QString &tracker) const
|
||||
return longHost.mid(index + 1);
|
||||
}
|
||||
|
||||
QStringList TrackerFiltersList::getHashes(int row)
|
||||
QStringList TrackerFiltersList::getHashes(const int row) const
|
||||
{
|
||||
if (row == 1)
|
||||
switch (row) {
|
||||
case 1:
|
||||
return m_trackers.value("");
|
||||
if (row == 2)
|
||||
case 2:
|
||||
return m_errors.keys();
|
||||
if (row == 3)
|
||||
case 3:
|
||||
return m_warnings.keys();
|
||||
|
||||
return m_trackers.value(trackerFromRow(row));
|
||||
default:
|
||||
return m_trackers.value(trackerFromRow(row));
|
||||
}
|
||||
}
|
||||
|
||||
TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferListWidget *transferList, const bool downloadFavicon)
|
||||
|
@ -126,7 +126,7 @@ private:
|
||||
QString trackerFromRow(int row) const;
|
||||
int rowFromTracker(const QString &tracker) const;
|
||||
QString getHost(const QString &tracker) const;
|
||||
QStringList getHashes(int row);
|
||||
QStringList getHashes(int row) const;
|
||||
void downloadFavicon(const QString &url);
|
||||
|
||||
QHash<QString, QStringList> m_trackers;
|
||||
|
Loading…
x
Reference in New Issue
Block a user