mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug Fix - #209
- Not a fix, but working towards a fix. When a recurring task is edited, the other sibling tasks are not modified. This is difficult to do. Perhaps we can skip for 1.8.
This commit is contained in:
parent
3fce45baa4
commit
c5809b6b8d
1 changed files with 100 additions and 71 deletions
69
src/edit.cpp
69
src/edit.cpp
|
@ -512,22 +512,7 @@ static void parseTask (Task& task, const std::string& after)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Introducing the Silver Bullet. This feature is the catch-all fixative for
|
||||
// various other ills. This is like opening up the hood and going in with a
|
||||
// wrench. To be used sparingly.
|
||||
std::string handleEdit ()
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.get ("locking", true));
|
||||
handleRecurrence ();
|
||||
context.tdb.loadPending (tasks, context.filter);
|
||||
|
||||
// Filter sequence.
|
||||
context.filter.applySequence (tasks, context.sequence);
|
||||
|
||||
foreach (task, tasks)
|
||||
void editFile (Task& task)
|
||||
{
|
||||
// Check for file permissions.
|
||||
std::string dataLocation = expandPath (context.config.get ("data.location"));
|
||||
|
@ -536,10 +521,10 @@ std::string handleEdit ()
|
|||
|
||||
// Create a temp file name in data.location.
|
||||
std::stringstream file;
|
||||
file << dataLocation << "/task." << getpid () << "." << task->id << ".task";
|
||||
file << dataLocation << "/task." << getpid () << "." << task.id << ".task";
|
||||
|
||||
// Format the contents, T -> text, write to a file.
|
||||
std::string before = formatTask (*task);
|
||||
std::string before = formatTask (task);
|
||||
spit (file.str (), before);
|
||||
|
||||
// Determine correct editor: .taskrc:editor > $VISUAL > $EDITOR > vi
|
||||
|
@ -576,8 +561,7 @@ ARE_THESE_REALLY_HARMFUL:
|
|||
|
||||
try
|
||||
{
|
||||
parseTask (*task, after);
|
||||
context.tdb.update (*task);
|
||||
parseTask (task, after);
|
||||
}
|
||||
|
||||
catch (std::string& e)
|
||||
|
@ -605,6 +589,51 @@ ARE_THESE_REALLY_HARMFUL:
|
|||
unlink (file.str ().c_str ());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Introducing the Silver Bullet. This feature is the catch-all fixative for
|
||||
// various other ills. This is like opening up the hood and going in with a
|
||||
// wrench. To be used sparingly.
|
||||
std::string handleEdit ()
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.get ("locking", true));
|
||||
handleRecurrence ();
|
||||
Filter filter;
|
||||
context.tdb.loadPending (tasks, filter);
|
||||
|
||||
// Filter sequence.
|
||||
std::vector <Task> all = tasks;
|
||||
context.filter.applySequence (tasks, context.sequence);
|
||||
|
||||
foreach (task, tasks)
|
||||
{
|
||||
editFile (*task);
|
||||
context.tdb.update (*task);
|
||||
/*
|
||||
foreach (other, all)
|
||||
{
|
||||
if (other->id != task.id) // Don't edit the same task again.
|
||||
{
|
||||
if (task.has ("parent") &&
|
||||
if (other is parent of task)
|
||||
{
|
||||
// Transfer everything but mask, imask, uuid, parent.
|
||||
}
|
||||
else if (task is parent of other)
|
||||
{
|
||||
// Transfer everything but mask, imask, uuid, parent.
|
||||
}
|
||||
else if (task and other are siblings)
|
||||
{
|
||||
// Transfer everything but mask, imask, uuid, parent.
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue