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