mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Code Cleanup
- Removed obsolete deltaXXXX helper functions.
This commit is contained in:
parent
83c0ea6ab2
commit
b9ea9ca2db
2 changed files with 0 additions and 141 deletions
136
src/helpers.cpp
136
src/helpers.cpp
|
@ -222,139 +222,3 @@ static void countTasks (
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int deltaAppend (Task& task)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
if (context.task.has ("description"))
|
|
||||||
{
|
|
||||||
task.set ("description",
|
|
||||||
task.get ("description") + " " + context.task.get ("description"));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
int deltaPrepend (Task& task)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
if (context.task.has ("description"))
|
|
||||||
{
|
|
||||||
task.set ("description",
|
|
||||||
context.task.get ("description") + " " + task.get ("description"));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
int deltaDescription (Task& task)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
if (context.task.has ("description"))
|
|
||||||
{
|
|
||||||
task.set ("description", context.task.get ("description"));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
int deltaTags (Task& task)
|
|
||||||
{
|
|
||||||
int changes = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
// Apply or remove tags, if any.
|
|
||||||
std::vector <std::string> tags;
|
|
||||||
context.task.getTags (tags);
|
|
||||||
std::vector <std::string>::iterator tag;
|
|
||||||
for (tag = tags.begin (); tag != tags.end (); ++tag)
|
|
||||||
{
|
|
||||||
task.addTag (*tag);
|
|
||||||
++changes;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (tag = context.tagRemovals.begin (); tag != context.tagRemovals.end (); ++tag)
|
|
||||||
{
|
|
||||||
task.removeTag (*tag);
|
|
||||||
++changes;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return changes;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
int deltaAttributes (Task& task)
|
|
||||||
{
|
|
||||||
int changes = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
std::map <std::string, Att>::iterator att;
|
|
||||||
for (att = context.task.begin (); att != context.task.end (); ++att)
|
|
||||||
{
|
|
||||||
if (att->second.name () != "uuid" &&
|
|
||||||
att->second.name () != "description" &&
|
|
||||||
att->second.name () != "tags")
|
|
||||||
{
|
|
||||||
// Some things don't propagate to the parent task.
|
|
||||||
if (att->second.name () == "wait" &&
|
|
||||||
task.getStatus () == Task::recurring)
|
|
||||||
{
|
|
||||||
// NOP
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modifying "wait" changes status, but not for recurring parent tasks.
|
|
||||||
else if (att->second.name () == "wait")
|
|
||||||
{
|
|
||||||
if (att->second.value () == "")
|
|
||||||
{
|
|
||||||
task.remove (att->first);
|
|
||||||
task.setStatus (Task::pending);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
task.set (att->first, att->second.value ());
|
|
||||||
task.setStatus (Task::waiting);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modifying dependencies requires adding/removing uuids.
|
|
||||||
else if (att->second.name () == "depends")
|
|
||||||
{
|
|
||||||
std::vector <std::string> deps;
|
|
||||||
split (deps, att->second.value (), ',');
|
|
||||||
|
|
||||||
std::vector <std::string>::iterator i;
|
|
||||||
for (i = deps.begin (); i != deps.end (); i++)
|
|
||||||
{
|
|
||||||
int id = atoi (i->c_str ());
|
|
||||||
if (id < 0)
|
|
||||||
task.removeDependency (-id);
|
|
||||||
else
|
|
||||||
task.addDependency (id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now the generalized handling.
|
|
||||||
else if (att->second.value () == "")
|
|
||||||
task.remove (att->second.name ());
|
|
||||||
else
|
|
||||||
// One of the few places where the compound attribute name is used.
|
|
||||||
task.set (att->first, att->second.value ());
|
|
||||||
|
|
||||||
++changes;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return changes;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
|
@ -50,11 +50,6 @@ std::string getFullDescription (Task&, const std::string&);
|
||||||
std::string getDueDate (Task&, const std::string&);
|
std::string getDueDate (Task&, const std::string&);
|
||||||
std::string onProjectChange (Task&, bool scope = true);
|
std::string onProjectChange (Task&, bool scope = true);
|
||||||
std::string onProjectChange (Task&, Task&);
|
std::string onProjectChange (Task&, Task&);
|
||||||
int deltaAppend (Task&);
|
|
||||||
int deltaPrepend (Task&);
|
|
||||||
int deltaDescription (Task&);
|
|
||||||
int deltaTags (Task&);
|
|
||||||
int deltaAttributes (Task&);
|
|
||||||
|
|
||||||
// rules.cpp
|
// rules.cpp
|
||||||
void initializeColorRules ();
|
void initializeColorRules ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue