Commit graph

102 commits

Author SHA1 Message Date
Louis-Claude Canon
ebdcccbf41 Code Cleanup
- Clean duplicated and unused function.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-04-30 09:01:21 -04:00
Paul Beckingham
b5f4fa03d2 Performance
- Implemented Task::get_ref, which is a lower-cost attribute accessor.
- Called this in a few places.
2012-04-28 18:01:40 -04:00
Paul Beckingham
0c0f767688 Performance
- Added locally cached configuration for urgency coefficients, which effectively
  relocates expensive loop-invariants for the 'next' report.
2012-04-28 17:59:48 -04:00
Paul Beckingham
0918a7c79a Bug #973
- Fixed bug #973, including 'urgency' in the 'export' output (thanks to Andy
  Spiegl).
2012-04-15 19:45:42 -04:00
Paul Beckingham
77200d7eb4 Bug #837
- Fixed bug #837, which caused incorrect urgency calculations for tasks that
  have completed dependencies, and problems when editing those tasks (thanks
  to Matt Kraai).
- Added Task::addDependency (const std::string&) method for reconstructing
  dependencies on tasks with no ID.
- Modfified Task::urgency_blocked so that it considers the blocking task's
  status.  This is an expensive test, and so it is wrapped by a cheaper test
  to see if there are/were any dependencies at all.  This means that urgency
  calculations are not slowed for tasks without dependencies, and is slower
  but more accurate for tasks that do have dependencies.
- Modified edit command so that dependencies are shown as IDs or UUIDs
  depending on whether the task is pending or not.
- Modified edit command so that dependencies are parsed as IDs or UUIDs
  depending on whether the task is pending or not.
- Modified wording in the template of the edit command to reflect the above.
- Added unit tests bug.837.t.
2012-03-04 00:05:11 -05:00
Paul Beckingham
5feb736939 Bug
- Fixed problem where urgency was not properly calculated for waiting tasks.
- Tweaked urgency coefficients to make most of the values closer together, and
  therefore more sensitive.
- Inverted 'waiting' coefficient.
- Boosted 'next', 'due' and 'blocking' coefficients.
- Modified unit tests accordingly.
- Lessened the impact of 'blocked', 'project', 'tags' and 'age'.
2012-02-26 23:13:15 -05:00
Paul Beckingham
412396d35b Code Cleanup
- Removed restriction on waiting recurring tasks.
- Removed unused L10N string.
- Removed unnecessary include.
2012-02-05 10:08:10 -05:00
Paul Beckingham
ec96d929a0 Bug 879 - Description/Annotation ending with Slash Causes Problems
- Backslashes actually.  The escaping mechanism in the low-level parser
  was eating leading \ characters when it should not.  Very hard bug to
  find, trivial to fix.
- Added unit tests to several components while narrowing this down.
2012-01-29 15:36:05 -05:00
Paul Beckingham
6580095002 Copyright
- Year change.
2012-01-02 23:32:10 -05:00
Johannes Schlatow
69fecbb2c0 Urgency
- Age-dependet urgency calculation now normalizes.
2011-12-17 19:08:31 +01:00
Johannes Schlatow
3d33d90d57 Urgency
- Added a coefficient for ageing which is the increase (or decrease)
   of urgency per day. The calculated urgency offset due to ageing
   can be limited by setting urgency.age.max.
2011-12-16 20:54:03 +01:00
Paul Beckingham
c879eb6811 Code Cleanup
- Renamed recur.t to recur.sort.t, because more recur unit tests are on the
  way, and this one was a misnomer.
- Minor edits - whitespace.
2011-10-10 22:54:28 -04:00
Federico Hernandez
8116c6a103 License
- moving task from GPL to MIT license
  top level src directory
2011-10-08 00:04:01 +02:00
Paul Beckingham
a40d1bbf76 Bug #839
- Fixed hard-coded '1m'.  Must have been sleepy.
2011-09-21 07:34:48 -04:00
Paul Beckingham
d3c6ddb87f Bug #839
- Fixed bug #839, which caused problems when recurrence frequencies of '1m'
  were used.  This is an obsolete form, and should now be '1mo' (thanks to
  Gour D).
2011-09-21 00:32:13 -04:00
Paul Beckingham
776bfea402 Dependencies
- Fixed bug in Task::addDependency where a 'dup dep' error string was not
  properly composed, which cause the error message to be shown as 'k'.
- Relocated expression evaluation on modification to only be processed for
  date attributes.  This impacts DOM, but fixes more than it breaks.
- Corrected unit test that was expecting an old-style error message.
- Added protection against array overrun in next_mod_group.  Again.
2011-09-12 23:53:46 -04:00
Paul Beckingham
9ada2f554a Bug
- The modify command no longer claims that a task was modified if no
  changes were applied.
2011-09-11 13:49:07 -04:00
Paul Beckingham
bbe69fd129 Bug - substitutions
- Fixed bug in Task::substitute that contained incorrect assumptions about
  regex matches.
- Fixed bug in Task::substitute that matched against the annotation name,
  rather than the value for non-regex substitutions.
- Fixed bug that caused improper functioning of the 'global' substitution
  indicator.
- Removed unnecessary capturing parentheses that were added for regex searches.
2011-09-06 23:36:45 -04:00
Federico Hernandez
a8759c9196 Bug fix - Task.cpp
completing a task did set a entry date to completed date.
2011-09-07 00:10:40 +02:00
Paul Beckingham
cc24a3d2f0 Task Validation
- Made the validation more gentle - it no longer stomps on the status,
  which may help with bug #824.
2011-09-03 11:13:09 -04:00
Paul Beckingham
b09351c517 Task Validation
- Fixed validation bug whereby recurring child tasks inherited the
  parent status ("recurring") instead of the expected "pending".
- Modified 'add' command to code duplicated in Task::validate.
- Cleaned up associated bug.period.t unit test.
2011-08-31 01:34:59 -04:00
Paul Beckingham
8e34a02811 Task Validation
- Implemented more relaxed validation rules.
- Added quiet corrections for missing data.
2011-08-31 01:15:12 -04:00
Paul Beckingham
f14b414b9c Code Cleanup
- Eliminated obsolete composeYAML and composeCSV methods.  With export
  capabilities moving outside the core, these are no longer needed.
2011-08-29 21:33:34 -04:00
Paul Beckingham
28183711c4 Bug
- The export command included the value of date fields instead of the
  name of date fields.
2011-08-28 16:39:05 -04:00
Paul Beckingham
17dfbabb39 TDB2 & Task
- Fixed next_id handling in load_tasks.
- Removed unnecessary load in next_id.
- Added missing encode call.
index 8c0d2e9..3d1b7ce 100644
--- a/src/Task.cpp
+++ b/src/Task.cpp
@@ -528,7 +528,7 @@ std::string Task::composeF4 () const
     {
       ff4 += (first ? "" : " ")
            + it->first
-           + ":\"" + json::encode (it->second) + "\"";
+           + ":\"" + encode (json::encode (it->second)) + "\"";
       first = false;
     }
   }
2011-08-27 11:18:43 -04:00
Paul Beckingham
74c12e1dec Encode/Decode
- The tasks are now using JSON encodings, but in addition to JSON
  decodings, also need legacy decoding, providing backward compatibility.
2011-08-27 10:31:27 -04:00
Paul Beckingham
89d3b4e805 Bug #737
- Fixed bug #737, which allows wait dates after due dates, but provides a
  warning (thanks to Arkady Grudzinsky).
2011-08-23 21:36:09 -04:00
Paul Beckingham
9a126ce717 Error Handling
- Improved some task validation errors by including data.
- Improved the phrasing of some error to be less pompous.
- Marked validation errors that need to be downgraded to warnings.
2011-08-21 12:35:47 -04:00
Paul Beckingham
be0522d567 Annotation Collisions
- Annotation timestamps are now incremented until unique.  This prevents
  rapid, successive annotations colliding.  The kind that occur during
  unit tests and when using UI wrapper programs.
- Removed 'sleep' commands in unit tests that were added to circumvent
  this.  This speeds up the test suite somewhat.
2011-08-13 21:53:10 -04:00
Paul Beckingham
bfad448f82 TDB2 - id <--> uuid mapping
- Migrated TDB mapping over to TDB2 mapping, which occurs at the TF2 level.
  This should (soon) restore task dependencies.
2011-08-13 17:43:07 -04:00
Paul Beckingham
e238b94d1b Urgency
- Urgency recalc was not properly set with the task was modified.
- Corrected urgency formatting.
- Cleaned up some code in A3 and E9.
2011-08-12 23:08:54 -04:00
Paul Beckingham
e2a8f85a2f Task Refactoring
- Task is no longer a map of string to Att.  Att is itself a name/
  value pair, so the name was redundant.  Task is now a map of string
  to string.  This brings the obsoletion of Att much closer.
2011-08-07 22:41:25 -04:00
Paul Beckingham
6f980490bd Code Cleanup
- Merging Record and Task objects, step 4.
2011-08-07 17:03:39 -04:00
Paul Beckingham
740cacc49f Code Cleanup
- Merging Record and Task objects, step 3.
2011-08-07 16:40:02 -04:00
Paul Beckingham
33cfdec5a6 Code Cleanup
- Merging Record and Task objects, step 2.
2011-08-07 16:28:40 -04:00
Paul Beckingham
6d00337db3 Code Cleanup
- Merging Record and Task objects, step 1.
2011-08-07 16:23:23 -04:00
Paul Beckingham
cdda791c84 Command - import
- Implemented the import command, which only suports JSON.  It is
  the basis for all other import formats, which will be implemented
  as external scripts.
2011-08-07 02:10:50 -04:00
Paul Beckingham
7fbe124fe0 Unit Tests
- Added proper handling for when no command or filter is specified, and
  no rc.default.command exists.
- Improved wording on above error message.
- Fixed typo in previous commit (managed to check in code before the
  build completed, and ultimately failed).
- Now reports errors that occur during initialization at the same level
  of verbosity as during command execution.
2011-07-16 15:33:09 -04:00
Paul Beckingham
2135cb141d Task Validation
- Shifted test for priority values from Att.cpp to Task.cpp.
2011-07-16 14:22:12 -04:00
Paul Beckingham
8827f9c978 TDB2
- Implemented CmdAdd.cpp and CmdLog.cpp using TDB2.
- Implemented simple append writes in TDB2.
- Modified CmdImport to accept and parse JSON.
- Added more const-ness in DOM, Expression and Task, to allow TDB2::get_tasks
  to return a const vector ref, which is a Very Good Thing.
- Corrected usage for the export command.
- Implemented Task::urgency as a call to Task::urgency_c, which is a const
  overload to allow urgency calculations (without caching) for const Task
  objects.
- Removed obolete code from TDB.
- Added lots of diagnostic output for TDB2 - it's annoying, but will be
  gone soon.
- Added mention in CmdHelp of the new <filter> and <modifications>
  syntax elements.  Needs more.
- Added Command::filter overload which uses TDB2.  Not in use yet.
2011-07-13 23:53:57 -04:00
Paul Beckingham
8e0296468e Unit Tests
- Improved args.5.t, which was attempting to stop tasks that were
  not started.
2011-07-10 18:04:49 -04:00
Paul Beckingham
ba723db9d7 Helpers
- Implemented Task::setEnd.
- Updated all code to use Task::setEntry and Task::setEnd.
2011-07-10 11:07:00 -04:00
Paul Beckingham
f0d2af2651 Filter Bugs
- A substitution arg is categorized as "subst", but was tested for
  "substitution".
- The Arguments::is_multipart method was triggering on '/', which is
  wrong, but I can't remember why I put it in there.  Hmmm.
- When extracting a write-filter, substitutions after the command
  were generating an error, whereas they should be ignored.
- Task::substitute was modifying data even when the patterns were not
  matching.  Yikes.
- Added unit tests for en-passant modification of all types during
  done, delete, start, stop.
2011-07-10 01:03:52 -04:00
Paul Beckingham
2d4ee13a46 Urgency
- Broke out urgency into separate functions.
2011-07-04 00:28:44 -04:00
Paul Beckingham
63f91c2f88 Enhancement
- Implemented Record::get_date to eliminated the need to obtain a date
  as a string, then convert to time_t, then instantiate a Date.
2011-07-01 22:13:34 -04:00
Paul Beckingham
7d5f4fdfc7 I18N
- Localized Task.cpp
2011-07-01 21:50:23 -04:00
Paul Beckingham
877ecbc864 Commands - done
- The 'done' command now functional.
- Localized CmdDone.cpp.
2011-06-26 23:28:21 -04:00
Paul Beckingham
b58438bdd4 Regexes
- Added regex support to substirutions.
- Fixed bug that prevented 1.9.4 from shipping with regexes.  If the
  description is "aXXaaXXa", and the substitution is /XX/.../ then the
  first substitutions changes the length of the string to "a...aaXXa"
  and therefore invalidates the index for the second match, and makes
  this change: "a...a...Xa".  The fix is to keep a running 'skew' count
  of the difference in 'from' and 'to' length, to adjust the match
  indexes.
- Moved the helper deltaSubstitutions function into the Task object,
  which makes more sense.
- Cleaned up output composition for CmdAdd.
- Eliminated #ifdef FEATURE_REGEX.  They are here to stay.
2011-06-25 16:41:17 -04:00
Paul Beckingham
61e549c80c Code Cleanup
- Removed many more uses of the 'foreach' macro.
2011-06-04 23:02:18 -04:00
Paul Beckingham
690fa6e206 JSON
- Replaced old Tree-based parser with a faster, leaner parser.
  Currently lacking good error handling and a large test suite.
- Integrated new parser into Task object, for encode/decode.
- Replicated same basic unit tests.  Needs more.
- Fixed bug in handleShell that failed to call the new Context::initialize2.
- Removed debugging code from CmdInstall.
- Implemented format() that does not require width and precision args.
2011-05-20 00:18:36 -04:00