Skip to content

Commit

Permalink
Fix part of picotorrent#647
Browse files Browse the repository at this point in the history
  • Loading branch information
make-42 authored May 12, 2021
1 parent 66b084d commit c64bf4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/picotorrent/ui/models/torrentlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ int TorrentListModel::Compare(const wxDataViewItem& item1, const wxDataViewItem&

auto nameSort = [&hashSort](bool ascending, TorrentStatus const& l, TorrentStatus const& r) -> int
{
if (l.name < r.name) { return ascending ? -1 : 1; }
if (l.name > r.name) { return ascending ? 1 : -1; }
return hashSort(ascending, l, l);
auto compvalue = _strcmpi(l.name.c_str(),r.name.c_str());
if (compvalue < 0) { return ascending ? -1 : 1; }
else if (compvalue == 0) { return hashSort(ascending, l, l); }
else{ return ascending ? 1 : -1; }
};

switch (column)
Expand Down

0 comments on commit c64bf4c

Please sign in to comment.