mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Variant
::operator_hastag now uses contextTask for resolution.
This commit is contained in:
parent
56a70b00c4
commit
ca6940ba2e
3 changed files with 12 additions and 21 deletions
|
@ -917,29 +917,17 @@ bool Variant::operator_nopartial (const Variant& other) const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Variant::operator_hastag (const Variant& other) const
|
||||
bool Variant::operator_hastag (const Variant& other, const Task& task) const
|
||||
{
|
||||
Variant left (*this); // tags
|
||||
Variant right (other); // tag
|
||||
|
||||
left.cast (type_string);
|
||||
Variant right (other);
|
||||
right.cast (type_string);
|
||||
|
||||
std::vector <std::string> individual;
|
||||
split (individual, left._string, ',');
|
||||
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = individual.begin (); i != individual.end (); ++i)
|
||||
if (*i == right._string)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return task.hasTag (right._string);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Variant::operator_notag (const Variant& other) const
|
||||
bool Variant::operator_notag (const Variant& other, const Task& task) const
|
||||
{
|
||||
return ! operator_hastag (other);
|
||||
return ! operator_hastag (other, task);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue