CmdStop: Removed quotes from all tags before attempting an Interval::unTag

This commit is contained in:
Paul Beckingham 2016-04-05 20:43:58 -04:00
parent 2666da96c1
commit 8141d9d2fc

View file

@ -28,6 +28,7 @@
#include <commands.h> #include <commands.h>
#include <timew.h> #include <timew.h>
#include <Interval.h> #include <Interval.h>
#include <Lexer.h>
#include <iostream> #include <iostream>
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -46,6 +47,8 @@ int CmdStop (
{ {
// Stop it. // Stop it.
latest.end (Datetime ()); latest.end (Datetime ());
database.modifyInterval (latest);
log.write ("debug", std::string ("Stopped tracking: ") + latest.serialize ());
// User feedback. // User feedback.
std::cout << intervalSummarize (rules, latest); std::cout << intervalSummarize (rules, latest);
@ -55,10 +58,7 @@ int CmdStop (
auto words = cli.getWords (); auto words = cli.getWords ();
if (words.size ()) if (words.size ())
for (auto& word : cli.getWords ()) for (auto& word : cli.getWords ())
latest.untag (word); latest.untag (Lexer::dequote (word));
database.modifyInterval (latest);
log.write ("debug", std::string ("Stopped tracking: ") + latest.serialize ());
if (words.size () && if (words.size () &&
latest.tags ().size ()) latest.tags ().size ())