mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdChart: renderSubTotal wasn't actually conditional
This commit is contained in:
parent
198902821c
commit
1aed409832
1 changed files with 19 additions and 17 deletions
|
@ -323,26 +323,28 @@ static std::string renderSubTotal (
|
|||
time_t total_work)
|
||||
{
|
||||
std::stringstream out;
|
||||
if (rules.getBoolean ("reports." + type + ".total"))
|
||||
{
|
||||
int indent = (rules.getBoolean ("reports." + type + ".month") ? 4 : 0) +
|
||||
(rules.getBoolean ("reports." + type + ".week") ? 4 : 0) +
|
||||
(rules.getBoolean ("reports." + type + ".day") ? 3 : 0) +
|
||||
(rules.getBoolean ("reports." + type + ".weekday") ? 4 : 0);
|
||||
int spacing = rules.getInteger ("reports." + type + ".spacing");
|
||||
|
||||
int indent = (rules.getBoolean ("reports." + type + ".month") ? 4 : 0) +
|
||||
(rules.getBoolean ("reports." + type + ".week") ? 4 : 0) +
|
||||
(rules.getBoolean ("reports." + type + ".day") ? 3 : 0) +
|
||||
(rules.getBoolean ("reports." + type + ".weekday") ? 4 : 0);
|
||||
int spacing = rules.getInteger ("reports." + type + ".spacing");
|
||||
std::string pad (indent + ((last_hour - first_hour + 1) * (4 + spacing)) + 1, ' ');
|
||||
|
||||
std::string pad (indent + ((last_hour - first_hour + 1) * (4 + spacing)) + 1, ' ');
|
||||
int hours = total_work / 3600;
|
||||
int minutes = (total_work % 3600) / 60;
|
||||
|
||||
int hours = total_work / 3600;
|
||||
int minutes = (total_work % 3600) / 60;
|
||||
|
||||
out << pad
|
||||
<< Color ("underline").colorize (" ")
|
||||
<< '\n'
|
||||
<< pad
|
||||
<< std::setw (3) << std::setfill (' ') << hours
|
||||
<< ':'
|
||||
<< std::setw (2) << std::setfill ('0') << minutes
|
||||
<< '\n';
|
||||
out << pad
|
||||
<< Color ("underline").colorize (" ")
|
||||
<< '\n'
|
||||
<< pad
|
||||
<< std::setw (3) << std::setfill (' ') << hours
|
||||
<< ':'
|
||||
<< std::setw (2) << std::setfill ('0') << minutes
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
return out.str ();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue