diff --git a/src/E9.cpp b/src/E9.cpp index 55451dc9e..72385e652 100644 --- a/src/E9.cpp +++ b/src/E9.cpp @@ -238,7 +238,7 @@ void E9::operator_negate (Arg& result, Arg& right) result = coerce (right, Arg::type_number); result._value = format (- strtod (result._value.c_str (), NULL)); - std::cout << "# " << right << " --> " << result << "\n"; +// std::cout << "# " << right << " --> " << result << "\n"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/dependency.cpp b/src/dependency.cpp index b67497465..24b21cfe3 100644 --- a/src/dependency.cpp +++ b/src/dependency.cpp @@ -43,13 +43,15 @@ static bool followUpstream (const Task&, const Task&, std::vector & //////////////////////////////////////////////////////////////////////////////// // A task is blocked if it depends on tasks that are pending or waiting. +// +// 1 --> 2(pending) = blocked +// 3 --> 4(completed) = not blocked any more bool dependencyIsBlocked (const Task& task) { - if (task.has ("depends")) + std::string depends = task.get ("depends"); + if (depends != "") { - std::string depends = task.get ("depends"); -// const std::vector & all = context.tdb.getAllPending (); - std::vector all; // TODO Fix. + const std::vector & all = context.tdb2.pending.get_tasks (); std::vector ::const_iterator it; for (it = all.begin (); it != all.end (); ++it) if ((it->getStatus () == Task::pending || @@ -66,8 +68,7 @@ void dependencyGetBlocked (const Task& task, std::vector & blocked) { std::string uuid = task.get ("uuid"); -// const std::vector & all = context.tdb.getAllPending (); - std::vector all; // TODO Fix. + const std::vector & all = context.tdb2.pending.get_tasks (); std::vector ::const_iterator it; for (it = all.begin (); it != all.end (); ++it) if ((it->getStatus () == Task::pending || @@ -85,8 +86,7 @@ bool dependencyIsBlocking (const Task& task) { std::string uuid = task.get ("uuid"); -// const std::vector & all = context.tdb.getAllPending (); - std::vector all; // TODO Fix. + const std::vector & all = context.tdb2.pending.get_tasks (); std::vector ::const_iterator it; for (it = all.begin (); it != all.end (); ++it) if ((it->getStatus () == Task::pending || @@ -104,8 +104,7 @@ void dependencyGetBlocking (const Task& task, std::vector & blocking) std::string depends = task.get ("depends"); if (depends != "") { -// const std::vector & all = context.tdb.getAllPending (); - std::vector all; // TODO Fix. + const std::vector & all = context.tdb2.pending.get_tasks (); std::vector ::const_iterator it; for (it = all.begin (); it != all.end (); ++it) if ((it->getStatus () == Task::pending ||