mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Use 'auto' to avoid duplicating the type name
This commit is contained in:
@@ -104,8 +104,8 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex
|
||||
// In this case QSortFilterProxyModel::lessThan() converts other types to QString and
|
||||
// sorts them.
|
||||
// Thus we can't use the code in the default label.
|
||||
const BitTorrent::TorrentState leftValue = left.data().value<BitTorrent::TorrentState>();
|
||||
const BitTorrent::TorrentState rightValue = right.data().value<BitTorrent::TorrentState>();
|
||||
const auto leftValue = left.data().value<BitTorrent::TorrentState>();
|
||||
const auto rightValue = right.data().value<BitTorrent::TorrentState>();
|
||||
if (leftValue != rightValue)
|
||||
return leftValue < rightValue;
|
||||
|
||||
@@ -261,7 +261,7 @@ bool TransferListSortModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
|
||||
|
||||
bool TransferListSortModel::matchFilter(int sourceRow, const QModelIndex &sourceParent) const
|
||||
{
|
||||
TransferListModel *model = qobject_cast<TransferListModel *>(sourceModel());
|
||||
auto *model = qobject_cast<TransferListModel *>(sourceModel());
|
||||
if (!model) return false;
|
||||
|
||||
BitTorrent::TorrentHandle *const torrent = model->torrentHandle(model->index(sourceRow, 0, sourceParent));
|
||||
|
||||
Reference in New Issue
Block a user