mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
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:
parent
07a18f4fae
commit
7a9d314016
1 changed files with 36 additions and 2 deletions
|
@ -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 ())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue