diff --git a/src/Record.cpp b/src/Record.cpp index dd4964040..f92d8db6e 100644 --- a/src/Record.cpp +++ b/src/Record.cpp @@ -39,18 +39,3 @@ extern Context context; -//////////////////////////////////////////////////////////////////////////////// -Record::Record () -{ -} - -//////////////////////////////////////////////////////////////////////////////// -Record::Record (const std::string& input) -{ -} - -//////////////////////////////////////////////////////////////////////////////// -Record::~Record () -{ -} - diff --git a/src/Record.h b/src/Record.h index e3547d9a2..80041361f 100644 --- a/src/Record.h +++ b/src/Record.h @@ -36,10 +36,6 @@ class Record : public std::map { -public: - Record (); // Default constructor - Record (const std::string&); // Copy constructor - virtual ~Record (); // Destructor }; #endif diff --git a/src/Task.cpp b/src/Task.cpp index c70a15bb1..a3a4f746e 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -28,6 +28,7 @@ #define L10N // Localization complete. #include +#include #include #include #include @@ -55,11 +56,8 @@ Task::Task () //////////////////////////////////////////////////////////////////////////////// Task::Task (const Task& other) -: Record (other) -, id (other.id) -, urgency_value (other.urgency_value) -, recalc_urgency (other.recalc_urgency) { + *this = other; } //////////////////////////////////////////////////////////////////////////////// @@ -67,7 +65,8 @@ Task& Task::operator= (const Task& other) { if (this != &other) { - Record::operator= (other); + std::map ::operator= (other); + id = other.id; urgency_value = other.urgency_value; recalc_urgency = other.recalc_urgency; @@ -83,7 +82,7 @@ bool Task::operator== (const Task& other) if (size () != other.size ()) return false; - std::map ::iterator att; + Task::iterator att; for (att = this->begin (); att != this->end (); ++att) if (att->second.name () != "uuid") if (att->second.value () != other.get (att->second.name ())) @@ -174,7 +173,7 @@ bool Task::has (const std::string& name) const std::vector Task::all () { std::vector all; - std::map ::iterator i; + Task::iterator i; for (i = this->begin (); i != this->end (); ++i) all.push_back (i->second); @@ -269,7 +268,7 @@ void Task::setStatus (Task::status status) } //////////////////////////////////////////////////////////////////////////////// -// Attempt an FF4 parse first, using Record::parse, and in the event of an error +// Attempt an FF4 parse first, using Task::parse, and in the event of an error // try a legacy parse (F3, FF2). Note that FF1 is no longer supported. // // start --> [ --> Att --> ] --> end @@ -286,7 +285,6 @@ void Task::parse (const std::string& input) try { -// Record::parse (copy); clear (); Nibbler n (copy); @@ -510,7 +508,7 @@ std::string Task::composeF4 () const std::string ff4 = "["; bool first = true; - std::map ::const_iterator it; + Task::const_iterator it; for (it = this->begin (); it != this->end (); ++it) { if (it->second.value () != "") @@ -632,7 +630,7 @@ std::string Task::composeJSON (bool include_id /*= false*/) const // First the non-annotations. int attributes_written = 0; int annotation_count = 0; - std::map ::const_iterator i; + Task::const_iterator i; for (i = this->begin (); i != this->end (); ++i) { if (attributes_written) @@ -727,7 +725,7 @@ void Task::getAnnotations (std::vector & annotations) const { annotations.clear (); - Record::const_iterator ci; + Task::const_iterator ci; for (ci = this->begin (); ci != this->end (); ++ci) if (ci->first.substr (0, 11) == "annotation_") annotations.push_back (ci->second); @@ -762,7 +760,7 @@ void Task::addAnnotation (const std::string& description) void Task::removeAnnotations () { // Erase old annotations. - Record::iterator i = this->begin (); + Task::iterator i = this->begin (); while (i != this->end ()) { if (i->first.substr (0, 11) == "annotation_") diff --git a/src/Task.h b/src/Task.h index 4af7630cd..7155ae2ae 100644 --- a/src/Task.h +++ b/src/Task.h @@ -28,10 +28,13 @@ #define INCLUDED_TASK #define L10N // Localization complete. +#include +#include #include -#include +#include +#include -class Task : public Record +class Task : public std::map { public: Task (); // Default constructor