mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 05:48:47 +03:00
Merge pull request #8087 from sledgehammer999/fix_flag_sorting
Fix sorting of country flags column in Peers tab.
This commit is contained in:
commit
0a35adbdba
5 changed files with 9 additions and 29 deletions
|
@ -54,8 +54,6 @@ bool CategoryFilterProxyModel::lessThan(const QModelIndex &left, const QModelInd
|
|||
|
||||
int result = Utils::String::naturalCompare(left.data().toString(), right.data().toString()
|
||||
, Qt::CaseInsensitive);
|
||||
if (result != 0)
|
||||
return (result < 0);
|
||||
|
||||
return (left < right);
|
||||
return (result < 0);
|
||||
}
|
||||
|
|
|
@ -53,17 +53,11 @@ protected:
|
|||
const QString strL = left.data().toString();
|
||||
const QString strR = right.data().toString();
|
||||
const int result = Utils::String::naturalCompare(strL, strR, Qt::CaseInsensitive);
|
||||
if (result != 0)
|
||||
return (result < 0);
|
||||
|
||||
return (left < right);
|
||||
}
|
||||
return (result < 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (left.data() != right.data())
|
||||
return QSortFilterProxyModel::lessThan(left, right);
|
||||
|
||||
return (left < right);
|
||||
return QSortFilterProxyModel::lessThan(left, right);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -113,17 +113,11 @@ bool SearchSortModel::lessThan(const QModelIndex &left, const QModelIndex &right
|
|||
const QString strL = left.data().toString();
|
||||
const QString strR = right.data().toString();
|
||||
const int result = Utils::String::naturalCompare(strL, strR, Qt::CaseInsensitive);
|
||||
if (result != 0)
|
||||
return (result < 0);
|
||||
|
||||
return (left < right);
|
||||
}
|
||||
return (result < 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (left.data() != right.data())
|
||||
return base::lessThan(left, right);
|
||||
|
||||
return (left < right);
|
||||
return base::lessThan(left, right);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -54,8 +54,5 @@ bool TagFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &r
|
|||
|
||||
int result = Utils::String::naturalCompare(left.data().toString(), right.data().toString()
|
||||
, Qt::CaseInsensitive);
|
||||
if (result != 0)
|
||||
return (result < 0);
|
||||
|
||||
return (left < right);
|
||||
return (result < 0);
|
||||
}
|
||||
|
|
|
@ -95,10 +95,7 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex
|
|||
return lowerPositionThan(left, right);
|
||||
|
||||
const int result = Utils::String::naturalCompare(vL.toString(), vR.toString(), Qt::CaseInsensitive);
|
||||
if (result != 0)
|
||||
return (result < 0);
|
||||
|
||||
return (left < right);
|
||||
return (result < 0);
|
||||
}
|
||||
|
||||
case TorrentModel::TR_ADD_DATE:
|
||||
|
|
Loading…
Reference in a new issue