From 103bcef6ab02ae3f1c447c176204629d9a78544b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 21 Jan 2011 11:59:15 -0500 Subject: [PATCH 1/2] Bug - The edit command included two entries for the tags, parsing then only found the first. --- src/edit.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/edit.cpp b/src/edit.cpp index 19a4df070..acd460726 100644 --- a/src/edit.cpp +++ b/src/edit.cpp @@ -145,13 +145,15 @@ static std::string formatTask (Task task) join (allTags, " ", tags); if (verbose) - before << "# Separate the tags with spaces, like this: tag1 tag2\n" - << " Tags: " << allTags << "\n" - << "# The description field is allowed to wrap and use multiple lines. Task\n" + before << "# Separate the tags with spaces, like this: tag1 tag2\n"; + + before << " Tags: " << allTags << "\n"; + + if (verbose) + before << "# The description field is allowed to wrap and use multiple lines. Task\n" << "# will combine them.\n"; - before << " Tags: " << allTags << "\n" - << " Description: " << task.get ("description") << "\n" + before << " Description: " << task.get ("description") << "\n" << " Created: " << formatDate (task, "entry") << "\n" << " Started: " << formatDate (task, "start") << "\n" << " Ended: " << formatDate (task, "end") << "\n" From 8ed1cc60068df82d7a42ed6f73d723bbf299f069 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 21 Jan 2011 11:59:51 -0500 Subject: [PATCH 2/2] Bug - The _query command emitted this: [ {}, {}, {} ] which is not valid JSON. It should instead be: {}, {}, {} --- src/command.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index 9c2453f5c..781e05830 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -599,7 +599,6 @@ int handleQuery (std::string& outs) // Note: "limit:" feature not supported. // Compose output. - outs = "["; std::vector ::iterator t; for (t = tasks.begin (); t != tasks.end (); ++t) { @@ -609,8 +608,7 @@ int handleQuery (std::string& outs) outs += t->composeJSON (); } - outs += "]\n"; - + outs += "\n"; context.hooks.trigger ("post-query-command"); }