Variant: Temporarily put back the priority string handling

- In order to test that the UDA sorting is good, the priority processing must
  be in place, as many test rely on priority values. Will be removed later.
This commit is contained in:
Paul Beckingham 2015-04-04 16:16:51 -04:00
parent 07a18f4fae
commit 7a9d314016

View file

@ -315,6 +315,14 @@ bool Variant::operator< (const Variant& other) const
return left._string < right._string;
case type_string:
if (left.source () == "priority" || right.source () == "priority")
{
if (left._string != "H" && right._string == "H") return true;
else if (left._string == "L" && right._string == "M") return true;
else if (left._string == "" && right._string != "") return true;
else return false;
}
else
{
if (left._string == right._string)
return false;
@ -466,9 +474,18 @@ bool Variant::operator<= (const Variant& other) const
return left._string <= right._string;
case type_string:
if (left.source () == "priority" || right.source () == "priority")
{
if (left._string == right._string ) return true;
else if ( right._string == "H") return true;
else if (left._string == "L" && right._string == "M") return true;
else if (left._string == "" ) return true;
else return false;
}
else
{
if (left._string == right._string)
return false;
return true;
auto order = Task::customOrder.find (left.source ());
if (order != Task::customOrder.end ())
@ -617,6 +634,14 @@ bool Variant::operator> (const Variant& other) const
return left._string > right._string;
case type_string:
if (left.source () == "priority" || right.source () == "priority")
{
if (left._string == "H" && right._string != "H") return true;
else if (left._string == "M" && right._string == "L") return true;
else if (left._string != "" && right._string == "") return true;
else return false;
}
else
{
if (left._string == right._string)
return false;
@ -768,9 +793,18 @@ bool Variant::operator>= (const Variant& other) const
return left._string >= right._string;
case type_string:
if (left.source () == "priority" || right.source () == "priority")
{
if (left._string == right._string ) return true;
else if (left._string == "H" ) return true;
else if (left._string == "M" && right._string == "L") return true;
else if ( right._string == "" ) return true;
else return false;
}
else
{
if (left._string == right._string)
return false;
return true;
auto order = Task::customOrder.find (left.source ());
if (order != Task::customOrder.end ())