mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
helper: Propagated database to intervalSummarize
This commit is contained in:
parent
8870ba6bd0
commit
614619c11f
7 changed files with 12 additions and 9 deletions
|
@ -44,7 +44,7 @@ int CmdContinue (
|
|||
database.addInterval (latest);
|
||||
|
||||
if (rules.getBoolean ("verbose"))
|
||||
std::cout << intervalSummarize (rules, latest);
|
||||
std::cout << intervalSummarize (database, rules, latest);
|
||||
}
|
||||
else
|
||||
std::cout << "There is already active tracking.\n";
|
||||
|
|
|
@ -40,7 +40,7 @@ int CmdDefault (Rules& rules, Database& database)
|
|||
if (interval.range.is_open ())
|
||||
{
|
||||
if (rules.getBoolean ("verbose"))
|
||||
std::cout << intervalSummarize (rules, interval);
|
||||
std::cout << intervalSummarize (database, rules, interval);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ int CmdStart (
|
|||
|
||||
// TODO intervalSummarїze needs to operate on a vector of similar intervals.
|
||||
if (rules.getBoolean ("verbose"))
|
||||
std::cout << intervalSummarize (rules, modified);
|
||||
std::cout << intervalSummarize (database, rules, modified);
|
||||
}
|
||||
|
||||
// Now add the new open interval.
|
||||
|
@ -75,7 +75,7 @@ int CmdStart (
|
|||
// TODO intervalSummarїze needs to operate on a vector of similar intervals.
|
||||
// User feedback.
|
||||
if (rules.getBoolean ("verbose"))
|
||||
std::cout << intervalSummarize (rules, now);
|
||||
std::cout << intervalSummarize (database, rules, now);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ int CmdStop (
|
|||
|
||||
// TODO intervalSummarїze needs to operate on a vector of similar intervals.
|
||||
if (rules.getBoolean ("verbose"))
|
||||
std::cout << intervalSummarize (rules, modified);
|
||||
std::cout << intervalSummarize (database, rules, modified);
|
||||
|
||||
// If tags were specified, and after removing those tags, there are still
|
||||
// tags remaining, then add a contiguous interval.
|
||||
|
@ -75,7 +75,7 @@ int CmdStop (
|
|||
latest.range.end = Datetime (0);
|
||||
database.addInterval (latest);
|
||||
if (rules.getBoolean ("verbose"))
|
||||
std::cout << '\n' << intervalSummarize (rules, latest);
|
||||
std::cout << '\n' << intervalSummarize (database, rules, latest);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -47,7 +47,7 @@ int CmdTrack (
|
|||
database.addInterval (interval);
|
||||
|
||||
if (rules.getBoolean ("verbose"))
|
||||
std::cout << intervalSummarize (rules, filter);
|
||||
std::cout << intervalSummarize (database, rules, filter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,10 @@ Color tagColor (const Rules& rules, const std::string& tag)
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Summarize either an active or closed interval, for user feedback.
|
||||
std::string intervalSummarize (const Rules& rules, const Interval& interval)
|
||||
std::string intervalSummarize (
|
||||
Database& database,
|
||||
const Rules& rules,
|
||||
const Interval& interval)
|
||||
{
|
||||
std::stringstream out;
|
||||
if (interval.range.is_started ())
|
||||
|
|
|
@ -64,7 +64,7 @@ int dispatchCommand (const CLI&, Database&, Rules&, const Extensions&);
|
|||
|
||||
// helper.cpp
|
||||
Color tagColor (const Rules&, const std::string&);
|
||||
std::string intervalSummarize (const Rules&, const Interval&);
|
||||
std::string intervalSummarize (Database&, const Rules&, const Interval&);
|
||||
bool expandIntervalHint (const std::string&, std::string&, std::string&);
|
||||
std::string jsonFromIntervals (const std::vector <Interval>&);
|
||||
Palette createPalette (const Rules&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue