fixed #300: sorting of selected items may give wrong results

This commit is contained in:
Andrey Prygunkov
2016-10-31 19:05:15 +01:00
parent 80debf521a
commit 7fae337360

View File

@@ -126,7 +126,7 @@ bool GroupSorter::Execute(const char* sort)
m_sortOrder = soDescending;
}
std::sort(m_nzbList->begin(), m_nzbList->end(), *this);
std::stable_sort(m_nzbList->begin(), m_nzbList->end(), *this);
if (origSortOrder == soAuto &&
std::equal(tempList.begin(), tempList.end(), m_nzbList->begin(),
@@ -136,7 +136,7 @@ bool GroupSorter::Execute(const char* sort)
}))
{
m_sortOrder = m_sortOrder == soDescending ? soAscending : soDescending;
std::sort(m_nzbList->begin(), m_nzbList->end(), *this);
std::stable_sort(m_nzbList->begin(), m_nzbList->end(), *this);
}
return true;