mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Extract with_totals from renderSubTotals
This commit is contained in:
parent
551605a8ba
commit
9294fae712
1 changed files with 19 additions and 21 deletions
|
@ -217,8 +217,9 @@ int renderChart (
|
||||||
|
|
||||||
const auto with_summary = rules.getBoolean ("reports." + type + ".summary");
|
const auto with_summary = rules.getBoolean ("reports." + type + ".summary");
|
||||||
const auto with_holidays = rules.getBoolean ("reports." + type + ".holidays");
|
const auto with_holidays = rules.getBoolean ("reports." + type + ".holidays");
|
||||||
|
const auto with_totals = rules.getBoolean ("reports." + type + ".totals");
|
||||||
|
|
||||||
std::cout << renderSubTotal (type, rules, first_hour, last_hour, total_work)
|
std::cout << (with_totals ? renderSubTotal (type, rules, first_hour, last_hour, total_work) : "")
|
||||||
<< (with_holidays ? renderHolidays (rules, filter, rules.all ("holidays.")) : "")
|
<< (with_holidays ? renderHolidays (rules, filter, rules.all ("holidays.")) : "")
|
||||||
<< (with_summary ? renderSummary (indent, filter, exclusions, tracked, blank) : "");
|
<< (with_summary ? renderSummary (indent, filter, exclusions, tracked, blank) : "");
|
||||||
|
|
||||||
|
@ -415,8 +416,6 @@ static std::string renderSubTotal (
|
||||||
time_t total_work)
|
time_t total_work)
|
||||||
{
|
{
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
if (rules.getBoolean ("reports." + type + ".totals"))
|
|
||||||
{
|
|
||||||
auto indent = getIndentSize (type, rules);
|
auto indent = getIndentSize (type, rules);
|
||||||
int spacing = rules.getInteger ("reports." + type + ".spacing");
|
int spacing = rules.getInteger ("reports." + type + ".spacing");
|
||||||
|
|
||||||
|
@ -439,7 +438,6 @@ static std::string renderSubTotal (
|
||||||
<< ':'
|
<< ':'
|
||||||
<< std::setw (2) << std::setfill ('0') << minutes
|
<< std::setw (2) << std::setfill ('0') << minutes
|
||||||
<< '\n';
|
<< '\n';
|
||||||
}
|
|
||||||
|
|
||||||
return out.str ();
|
return out.str ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue