Use const bool uniformly for variable 'verbose'

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2020-08-08 18:35:04 +02:00
parent 6fe15d2643
commit a4a16ec2c5
14 changed files with 16 additions and 16 deletions

View file

@ -34,7 +34,7 @@ int CmdCancel (
Database& database,
Journal& journal)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
// If there is an open interval, cancel it by deleting it..
auto latest = getLatestInterval (database);

View file

@ -92,7 +92,7 @@ int renderChart (
Rules& rules,
Database& database)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
// Load the data.
const auto tracked = getTracked (database, rules, filter);

View file

@ -56,7 +56,7 @@ int CmdConfig (
return CmdShow (rules);
}
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
bool confirmation = rules.getBoolean ("confirmation");
std::string name = words[0];

View file

@ -32,7 +32,7 @@
// Returns 0 if tracking is active, 1 if not.
int CmdDefault (Rules& rules, Database& database)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
// Load the most recent interval, summarize and display.
auto interval = getLatestInterval (database);

View file

@ -36,7 +36,7 @@ int CmdDelete (
Database& database,
Journal& journal)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
// Gather IDs.
std::set <int> ids = cli.getIds ();

View file

@ -37,7 +37,7 @@ int CmdFill (
Database& database,
Journal& journal)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
std::set <int> ids = cli.getIds ();

View file

@ -37,7 +37,7 @@ int CmdGaps (
Rules& rules,
Database& database)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
// If filter is empty, choose 'today'.
auto filter = cli.getFilter ();

View file

@ -37,7 +37,7 @@ int CmdModify (
Database& database,
Journal& journal)
{
bool verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
auto filter = cli.getFilter ();
std::set <int> ids = cli.getIds ();

View file

@ -35,7 +35,7 @@ int CmdStart (
Database& database,
Journal& journal)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
const Datetime now {};
auto interval = cli.getFilter ({now, 0});

View file

@ -47,7 +47,7 @@ int CmdStop (
Database& database,
Journal& journal)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
// Load the most recent interval.
auto filter = cli.getFilter ();

View file

@ -42,7 +42,7 @@ int CmdSummary (
Rules& rules,
Database& database)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
// Create a filter, and if empty, choose 'today'.
auto filter = cli.getFilter (Range { Datetime ("today"), Datetime ("tomorrow") });

View file

@ -38,7 +38,7 @@ int CmdTags (
Rules& rules,
Database& database)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
// Create a filter, with no default range.
auto filter = cli.getFilter ();

View file

@ -35,7 +35,7 @@ int CmdTrack (
Database& database,
Journal& journal)
{
auto boolean = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
auto filter = cli.getFilter ();
@ -52,9 +52,9 @@ int CmdTrack (
for (auto& interval : flatten (filter, getAllExclusions (rules, filter)))
{
database.addInterval (interval, boolean);
database.addInterval (interval, verbose);
if (boolean)
if (verbose)
std::cout << intervalSummarize (database, rules, interval);
}

View file

@ -62,7 +62,7 @@ static void undoConfigAction (UndoAction& action, Rules &rules, Journal& journal
////////////////////////////////////////////////////////////////////////////////
int CmdUndo (Rules& rules, Database& database, Journal& journal)
{
auto verbose = rules.getBoolean ("verbose");
const bool verbose = rules.getBoolean ("verbose");
Transaction transaction = journal.popLastTransaction ();