From 03c9b96955f8b5c5d129d64052c23b694f1ea4e0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 7 Aug 2010 00:40:45 -0400 Subject: [PATCH] Output Cleanup - No point display "blocked by" and "is blocking" in the info report if there are no other tasks to list. --- src/report.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/report.cpp b/src/report.cpp index fee8d66e9..6640781f7 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -424,10 +424,11 @@ int handleInfo (std::string &outs) } // dependencies: blocked - row = table.addRow (); - table.addCell (row, 0, "This task blocked by"); if (task->has ("depends")) { + row = table.addRow (); + table.addCell (row, 0, "This task blocked by"); + std::string depends = task->get ("depends"); const std::vector & rpending = context.tdb.getAllPending (); @@ -442,9 +443,6 @@ int handleInfo (std::string &outs) // dependencies: blocking { - row = table.addRow (); - table.addCell (row, 0, "This task is blocking"); - std::string uuid = task->get ("uuid"); const std::vector & rpending = context.tdb.getAllPending (); @@ -454,7 +452,12 @@ int handleInfo (std::string &outs) if (it->get ("depends").find (uuid) != std::string::npos) blocked << it->id << " " << it->get ("description") << "\n"; - table.addCell (row, 1, blocked.str ()); + if (blocked.str().length ()) + { + row = table.addRow (); + table.addCell (row, 0, "This task is blocking"); + table.addCell (row, 1, blocked.str ()); + } } if (task->getStatus () == Task::recurring ||