From 30cfc11f809fa68978f06913617745db552f8f1d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 13 Nov 2016 13:12:07 -0500 Subject: [PATCH] Context: Uses inline member initialization --- src/Context.cpp | 15 --------------- src/Context.h | 48 +++++++++++++++++++++--------------------------- 2 files changed, 21 insertions(+), 42 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index 2b7452117..693c09a47 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -74,21 +74,6 @@ static const char* modifierNames[] = #define NUM_MODIFIER_NAMES (sizeof (modifierNames) / sizeof (modifierNames[0])) -//////////////////////////////////////////////////////////////////////////////// -Context::Context () -: rc_file ("~/.taskrc") -, data_dir ("~/.task") -, config () -, tdb2 () -, determine_color_use (true) -, use_color (true) -, run_gc (true) -, verbosity_legacy (false) -, terminal_width (0) -, terminal_height (0) -{ -} - //////////////////////////////////////////////////////////////////////////////// Context::~Context () { diff --git a/src/Context.h b/src/Context.h index 33b59f67f..208cede89 100644 --- a/src/Context.h +++ b/src/Context.h @@ -41,7 +41,7 @@ class Context { public: - Context (); // Default constructor + Context () = default; // Default constructor ~Context (); // Destructor Context (const Context&); @@ -77,32 +77,26 @@ private: void propagateDebug (); public: - CLI2 cli2; - std::string home_dir; - File rc_file; - Path data_dir; - Config config; - - TDB2 tdb2; - Hooks hooks; - - bool determine_color_use; - bool use_color; - - bool run_gc; - - bool verbosity_legacy; - std::set verbosity; - std::vector headers; - std::vector footnotes; - std::vector errors; - std::vector debugMessages; - - std::map commands; - std::map columns; - - int terminal_width; - int terminal_height; + CLI2 cli2 {}; + std::string home_dir {}; + File rc_file {"~/.taskrc"}; + Path data_dir {"~/.task"}; + Config config {}; + TDB2 tdb2 {}; + Hooks hooks {}; + bool determine_color_use {true}; + bool use_color {true}; + bool run_gc {true}; + bool verbosity_legacy {false}; + std::set verbosity {}; + std::vector headers {}; + std::vector footnotes {}; + std::vector errors {}; + std::vector debugMessages {}; + std::map commands {}; + std::map columns {}; + int terminal_width {0}; + int terminal_height {0}; Timer timer_total {}; long time_init_us {0};