Use 'auto' to avoid duplicating the type name

This commit is contained in:
thalieht 2019-02-13 17:12:02 +02:00
parent 947c7e1d64
commit d8cbc9266a
25 changed files with 68 additions and 68 deletions

View file

@ -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));