/////////////////////////////////////////////////////////////////////////// The timestamp is part of the name: annotation_1234567890:"..." Note that the time is incremented (one second) in order to find a unique timestamp.
| 920 | // Note that the time is incremented (one second) in order to find a unique |
| 921 | // timestamp. |
| 922 | void Task::addAnnotation(const std::string& description) { |
| 923 | time_t now = time(nullptr); |
| 924 | std::string key; |
| 925 | |
| 926 | do { |
| 927 | key = "annotation_" + format((long long int)now); |
| 928 | ++now; |
| 929 | } while (has(key)); |
| 930 | |
| 931 | data[key] = description; |
| 932 | ++annotation_count; |
| 933 | recalc_urgency = true; |
| 934 | } |
| 935 | |
| 936 | //////////////////////////////////////////////////////////////////////////////// |
| 937 | void Task::removeAnnotations() { |