mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Commands - delete
- The delete command is now working.
This commit is contained in:
parent
877ecbc864
commit
2ac33089b1
1 changed files with 11 additions and 10 deletions
|
@ -29,6 +29,8 @@
|
||||||
#include <Context.h>
|
#include <Context.h>
|
||||||
#include <Permission.h>
|
#include <Permission.h>
|
||||||
#include <util.h>
|
#include <util.h>
|
||||||
|
#include <text.h>
|
||||||
|
#include <i18n.h>
|
||||||
#include <main.h>
|
#include <main.h>
|
||||||
#include <CmdDelete.h>
|
#include <CmdDelete.h>
|
||||||
|
|
||||||
|
@ -48,22 +50,22 @@ CmdDelete::CmdDelete ()
|
||||||
int CmdDelete::execute (std::string& output)
|
int CmdDelete::execute (std::string& output)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
/*
|
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
|
|
||||||
context.disallowModification ();
|
context.disallowModification ();
|
||||||
|
|
||||||
std::vector <Task> tasks;
|
std::vector <Task> tasks;
|
||||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||||
Filter filter;
|
context.tdb.loadPending (tasks);
|
||||||
context.tdb.loadPending (tasks, filter);
|
|
||||||
|
|
||||||
// Filter sequence.
|
|
||||||
std::vector <Task> all = tasks;
|
std::vector <Task> all = tasks;
|
||||||
context.filter.applySequence (tasks, context.sequence);
|
|
||||||
if (tasks.size () == 0)
|
// Apply filter.
|
||||||
|
std::vector <Task> filtered;
|
||||||
|
filter (tasks, filtered);
|
||||||
|
|
||||||
|
if (filtered.size () == 0)
|
||||||
{
|
{
|
||||||
context.footnote ("No tasks specified.");
|
context.footnote (STRING_FEEDBACK_NO_TASKS_SP);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +74,7 @@ int CmdDelete::execute (std::string& output)
|
||||||
sprintf (endTime, "%u", (unsigned int) time (NULL));
|
sprintf (endTime, "%u", (unsigned int) time (NULL));
|
||||||
|
|
||||||
std::vector <Task>::iterator task;
|
std::vector <Task>::iterator task;
|
||||||
for (task = tasks.begin (); task != tasks.end (); ++task)
|
for (task = filtered.begin (); task != filtered.end (); ++task)
|
||||||
{
|
{
|
||||||
if (task->getStatus () == Task::pending ||
|
if (task->getStatus () == Task::pending ||
|
||||||
task->getStatus () == Task::waiting)
|
task->getStatus () == Task::waiting)
|
||||||
|
@ -185,7 +187,6 @@ int CmdDelete::execute (std::string& output)
|
||||||
context.tdb.unlock ();
|
context.tdb.unlock ();
|
||||||
|
|
||||||
output = out.str ();
|
output = out.str ();
|
||||||
*/
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue