mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Use const bool
uniformly for variable 'verbose'
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
6fe15d2643
commit
a4a16ec2c5
14 changed files with 16 additions and 16 deletions
|
@ -34,7 +34,7 @@ int CmdCancel (
|
||||||
Database& database,
|
Database& database,
|
||||||
Journal& journal)
|
Journal& journal)
|
||||||
{
|
{
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
// If there is an open interval, cancel it by deleting it..
|
// If there is an open interval, cancel it by deleting it..
|
||||||
auto latest = getLatestInterval (database);
|
auto latest = getLatestInterval (database);
|
||||||
|
|
|
@ -92,7 +92,7 @@ int renderChart (
|
||||||
Rules& rules,
|
Rules& rules,
|
||||||
Database& database)
|
Database& database)
|
||||||
{
|
{
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
// Load the data.
|
// Load the data.
|
||||||
const auto tracked = getTracked (database, rules, filter);
|
const auto tracked = getTracked (database, rules, filter);
|
||||||
|
|
|
@ -56,7 +56,7 @@ int CmdConfig (
|
||||||
return CmdShow (rules);
|
return CmdShow (rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
bool confirmation = rules.getBoolean ("confirmation");
|
bool confirmation = rules.getBoolean ("confirmation");
|
||||||
std::string name = words[0];
|
std::string name = words[0];
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
// Returns 0 if tracking is active, 1 if not.
|
// Returns 0 if tracking is active, 1 if not.
|
||||||
int CmdDefault (Rules& rules, Database& database)
|
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.
|
// Load the most recent interval, summarize and display.
|
||||||
auto interval = getLatestInterval (database);
|
auto interval = getLatestInterval (database);
|
||||||
|
|
|
@ -36,7 +36,7 @@ int CmdDelete (
|
||||||
Database& database,
|
Database& database,
|
||||||
Journal& journal)
|
Journal& journal)
|
||||||
{
|
{
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
// Gather IDs.
|
// Gather IDs.
|
||||||
std::set <int> ids = cli.getIds ();
|
std::set <int> ids = cli.getIds ();
|
||||||
|
|
|
@ -37,7 +37,7 @@ int CmdFill (
|
||||||
Database& database,
|
Database& database,
|
||||||
Journal& journal)
|
Journal& journal)
|
||||||
{
|
{
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
std::set <int> ids = cli.getIds ();
|
std::set <int> ids = cli.getIds ();
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ int CmdGaps (
|
||||||
Rules& rules,
|
Rules& rules,
|
||||||
Database& database)
|
Database& database)
|
||||||
{
|
{
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
// If filter is empty, choose 'today'.
|
// If filter is empty, choose 'today'.
|
||||||
auto filter = cli.getFilter ();
|
auto filter = cli.getFilter ();
|
||||||
|
|
|
@ -37,7 +37,7 @@ int CmdModify (
|
||||||
Database& database,
|
Database& database,
|
||||||
Journal& journal)
|
Journal& journal)
|
||||||
{
|
{
|
||||||
bool verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
auto filter = cli.getFilter ();
|
auto filter = cli.getFilter ();
|
||||||
std::set <int> ids = cli.getIds ();
|
std::set <int> ids = cli.getIds ();
|
||||||
|
|
|
@ -35,7 +35,7 @@ int CmdStart (
|
||||||
Database& database,
|
Database& database,
|
||||||
Journal& journal)
|
Journal& journal)
|
||||||
{
|
{
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
const Datetime now {};
|
const Datetime now {};
|
||||||
|
|
||||||
auto interval = cli.getFilter ({now, 0});
|
auto interval = cli.getFilter ({now, 0});
|
||||||
|
|
|
@ -47,7 +47,7 @@ int CmdStop (
|
||||||
Database& database,
|
Database& database,
|
||||||
Journal& journal)
|
Journal& journal)
|
||||||
{
|
{
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
// Load the most recent interval.
|
// Load the most recent interval.
|
||||||
auto filter = cli.getFilter ();
|
auto filter = cli.getFilter ();
|
||||||
|
|
|
@ -42,7 +42,7 @@ int CmdSummary (
|
||||||
Rules& rules,
|
Rules& rules,
|
||||||
Database& database)
|
Database& database)
|
||||||
{
|
{
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
// Create a filter, and if empty, choose 'today'.
|
// Create a filter, and if empty, choose 'today'.
|
||||||
auto filter = cli.getFilter (Range { Datetime ("today"), Datetime ("tomorrow") });
|
auto filter = cli.getFilter (Range { Datetime ("today"), Datetime ("tomorrow") });
|
||||||
|
|
|
@ -38,7 +38,7 @@ int CmdTags (
|
||||||
Rules& rules,
|
Rules& rules,
|
||||||
Database& database)
|
Database& database)
|
||||||
{
|
{
|
||||||
auto verbose = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
// Create a filter, with no default range.
|
// Create a filter, with no default range.
|
||||||
auto filter = cli.getFilter ();
|
auto filter = cli.getFilter ();
|
||||||
|
|
|
@ -35,7 +35,7 @@ int CmdTrack (
|
||||||
Database& database,
|
Database& database,
|
||||||
Journal& journal)
|
Journal& journal)
|
||||||
{
|
{
|
||||||
auto boolean = rules.getBoolean ("verbose");
|
const bool verbose = rules.getBoolean ("verbose");
|
||||||
|
|
||||||
auto filter = cli.getFilter ();
|
auto filter = cli.getFilter ();
|
||||||
|
|
||||||
|
@ -52,9 +52,9 @@ int CmdTrack (
|
||||||
|
|
||||||
for (auto& interval : flatten (filter, getAllExclusions (rules, filter)))
|
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);
|
std::cout << intervalSummarize (database, rules, interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ static void undoConfigAction (UndoAction& action, Rules &rules, Journal& journal
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int CmdUndo (Rules& rules, Database& database, 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 ();
|
Transaction transaction = journal.popLastTransaction ();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue