From 15373daf85e7236fedcf271ab5c80ee3c39222fd Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 31 Jan 2016 16:05:00 -0500 Subject: [PATCH] Task: Improved CppCoreGuideline compliance --- src/Task.cpp | 12 ------------ src/Task.h | 19 ++++++++----------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/Task.cpp b/src/Task.cpp index 87de13d6f..a99e14eac 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -88,18 +88,6 @@ std::map > Task::customOrder; static const std::string dummy (""); -//////////////////////////////////////////////////////////////////////////////// -Task::Task () -: data () -, id (0) -, urgency_value (0.0) -, recalc_urgency (true) -, is_blocked (false) -, is_blocking (false) -, annotation_count (0) -{ -} - //////////////////////////////////////////////////////////////////////////////// // The uuid and id attributes must be exempt from comparison. // diff --git a/src/Task.h b/src/Task.h index 18aafdba1..75e96eec0 100644 --- a/src/Task.h +++ b/src/Task.h @@ -57,13 +57,11 @@ public: static float urgencyAgeMax; public: - Task (); // Default constructor + Task () = default; // Default constructor bool operator== (const Task&); // Comparison operator Task (const std::string&); // Parse Task (const json::object*); // Parse - std::map data; - void parse (const std::string&); std::string composeF4 () const; std::string composeJSON (bool decorate = false) const; @@ -75,14 +73,13 @@ public: enum dateState {dateNotDue, dateAfterToday, dateLaterToday, dateEarlierToday, dateBeforeToday}; // Public data. - int id; - float urgency_value; - bool recalc_urgency; - - bool is_blocked; - bool is_blocking; - - int annotation_count; + std::map data {}; + int id {0}; + float urgency_value {0.0}; + bool recalc_urgency {true}; + bool is_blocked {false}; + bool is_blocking {false}; + int annotation_count {0}; // Series of helper functions. static status textToStatus (const std::string&);