From 7fae337360a49367fb471abf37eaaccba87c0b46 Mon Sep 17 00:00:00 2001 From: Andrey Prygunkov Date: Mon, 31 Oct 2016 19:05:15 +0100 Subject: [PATCH] fixed #300: sorting of selected items may give wrong results --- daemon/queue/QueueEditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/queue/QueueEditor.cpp b/daemon/queue/QueueEditor.cpp index 789ab7ee..24e4edfc 100644 --- a/daemon/queue/QueueEditor.cpp +++ b/daemon/queue/QueueEditor.cpp @@ -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;