From 1872a87838f6b2c995bd9f19c3b4d9b84cfc82ae Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 6 Oct 2013 17:59:55 -0400 Subject: [PATCH] Bug #1268 - #1268 Edit doesn't accept changes, if task has completed dependency (thanks to Dmitriy Matrosov, Michele Santullo). --- AUTHORS | 2 ++ ChangeLog | 2 ++ src/Task.cpp | 5 ----- src/commands/CmdEdit.cpp | 16 +++------------- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/AUTHORS b/AUTHORS index aa6914eb5..3e4dae85a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -183,3 +183,5 @@ suggestions: Ben Armstrong XTaran John West + Dmitriy Matrosov + Michele Santullo diff --git a/ChangeLog b/ChangeLog index c590df4b9..aaa873591 100644 --- a/ChangeLog +++ b/ChangeLog @@ -67,6 +67,8 @@ Bugs Wilk). + #1263 The 'waiting' report properly lists only pending tasks with a wait date (thanks to Fidel Mato). + + #1268 Edit doesn't accept changes, if task has completed dependency (thanks + to Dmitriy Matrosov, Michele Santullo). + #1270 The 'undo' command is now properly removing backlog entries. + #1273 Query with negative relative date differs greatly from absolute date in past (thanks to John West). diff --git a/src/Task.cpp b/src/Task.cpp index 3ff4ccfe4..30a28c199 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -990,11 +990,6 @@ void Task::addDependency (const std::string& uuid) if (uuid == get ("uuid")) throw std::string (STRING_TASK_DEPEND_ITSELF); - // Check that uuid is resolvable. - int id = context.tdb2.pending.id (uuid); - if (id == 0) - throw format (STRING_TASK_DEPEND_MISS_CREA, id); - // Store the dependency. std::string depends = get ("depends"); if (depends != "") diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 03b24f718..d716f64fd 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -660,20 +660,10 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string std::vector ::iterator dep; for (dep = dependencies.begin (); dep != dependencies.end (); ++dep) { - std::vector ids; - - // Crude UUID check - if (dep->length () == 36) - { - int id = context.tdb2.pending.id (*dep); - ids.push_back (id); - } + if (dep->length () >= 7) + task.addDependency (*dep); else - A3::extract_id (*dep, ids); - - std::vector ::iterator id; - for (id = ids.begin (); id != ids.end(); id++) - task.addDependency (*id); + task.addDependency ((int) strtol (dep->c_str (), NULL, 10)); } // UDAs