mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-05 14:07:21 +02:00
use the existing (but misnamed) orphans method
This commit is contained in:
parent
e768e2c100
commit
e3dd91d45e
4 changed files with 5 additions and 9 deletions
|
@ -1559,7 +1559,7 @@ bool Task::isAnnotationAttr(const std::string& attr)
|
||||||
#ifdef PRODUCT_TASKWARRIOR
|
#ifdef PRODUCT_TASKWARRIOR
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// A UDA Orphan is an attribute that is not represented in context.columns.
|
// A UDA Orphan is an attribute that is not represented in context.columns.
|
||||||
std::vector <std::string> Task::getUDAOrphanUUIDs () const
|
std::vector <std::string> Task::getUDAOrphans () const
|
||||||
{
|
{
|
||||||
std::vector <std::string> orphans;
|
std::vector <std::string> orphans;
|
||||||
for (auto& it : data)
|
for (auto& it : data)
|
||||||
|
|
|
@ -159,7 +159,7 @@ public:
|
||||||
std::vector <Task> getBlockedTasks () const;
|
std::vector <Task> getBlockedTasks () const;
|
||||||
std::vector <Task> getDependencyTasks () const;
|
std::vector <Task> getDependencyTasks () const;
|
||||||
|
|
||||||
std::vector <std::string> getUDAOrphanUUIDs () const;
|
std::vector <std::string> getUDAOrphans () const;
|
||||||
|
|
||||||
void substitute (const std::string&, const std::string&, const std::string&);
|
void substitute (const std::string&, const std::string&, const std::string&);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -324,7 +324,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UDA orphans
|
// UDA orphans
|
||||||
auto orphans = task.getUDAOrphanUUIDs ();
|
auto orphans = task.getUDAOrphans ();
|
||||||
if (orphans.size ())
|
if (orphans.size ())
|
||||||
{
|
{
|
||||||
before << "# User Defined Attribute Orphans\n";
|
before << "# User Defined Attribute Orphans\n";
|
||||||
|
|
|
@ -134,12 +134,8 @@ int CmdUDAs::execute (std::string& output)
|
||||||
std::map <std::string, int> orphans;
|
std::map <std::string, int> orphans;
|
||||||
for (auto& i : filtered)
|
for (auto& i : filtered)
|
||||||
{
|
{
|
||||||
for (auto& att : i.data_removeme ())
|
for (auto& att : i.getUDAOrphans ())
|
||||||
if (! Task::isAnnotationAttr (att.first) &&
|
orphans[att]++;
|
||||||
! Task::isTagAttr (att.first) &&
|
|
||||||
! Task::isDepAttr (att.first) &&
|
|
||||||
Context::getContext ().columns.find (att.first) == Context::getContext ().columns.end ())
|
|
||||||
orphans[att.first]++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (orphans.size ())
|
if (orphans.size ())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue