diff --git a/ideas.txt b/ideas.txt index 147b30c14..afeaad490 100644 --- a/ideas.txt +++ b/ideas.txt @@ -21,7 +21,7 @@ Test Suite regression tests for every bug, command, feature Recurrence - - new T::status recurring (stored as R) + + new T::status recurring (stored as R) - new user-specifiable attributes - recur: [until:] - duration: daily, day, 1d diff --git a/src/T.cpp b/src/T.cpp index 118724e46..815b39c28 100644 --- a/src/T.cpp +++ b/src/T.cpp @@ -247,7 +247,7 @@ void T::setSubstitution (const std::string& from, const std::string& to) // uuid status [tags] [attributes] description // // uuid \x{8}-\x{4}-\x{4}-\x{4}-\x{12} -// status - O X +// status - + X r // tags \w+ \s ... // attributes \w+:\w+ \s ... // description .+ @@ -261,6 +261,7 @@ const std::string T::compose () const if (mStatus == pending) line += "- ["; else if (mStatus == completed) line += "+ ["; else if (mStatus == deleted) line += "X ["; + else if (mStatus == recurring) line += "r ["; // Tags for (size_t i = 0; i < mTags.size (); ++i) @@ -303,6 +304,7 @@ const std::string T::composeCSV () if (mStatus == pending) line += "'pending',"; else if (mStatus == completed) line += "'completed',"; else if (mStatus == deleted) line += "'deleted',"; + else if (mStatus == recurring) line += "'recurring',"; // Tags line += "'"; @@ -499,7 +501,7 @@ int T::determineVersion (const std::string& line) line[18] == '-' && line[23] == '-' && line[36] == ' ' && - (line[37] == '-' || line[37] == '+' || line[37] == 'X')) + (line[37] == '-' || line[37] == '+' || line[37] == 'X' || line[37] == 'r')) return 2; // Version 3? diff --git a/src/T.h b/src/T.h index 4837bd5a9..58b7cc169 100644 --- a/src/T.h +++ b/src/T.h @@ -37,7 +37,7 @@ class T { public: - enum status {pending, completed, deleted}; + enum status {pending, completed, deleted, recurring}; T (); // Default constructor T (const std::string&); // Initialize by parsing storage format