Commit graph

2630 commits

Author SHA1 Message Date
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
1392c8e619 Typo
- Wrong variable name.  Should have run the tests first.
2011-08-27 10:46:49 -04:00
Paul Beckingham
df2a319201 Enhancement
- The 'stats' command now includes the new data files in the 'data size'
  calculation.
2011-08-27 10:39:21 -04:00
Paul Beckingham
bceccba6eb Code Cleanup
- The str_replace is no longer needed.
2011-08-27 10:38:48 -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
1c2a4981ac Helper functions
- Rescued the str_replace function from Att.
2011-08-27 10:22:40 -04:00
Paul Beckingham
e5acabc452 Helper functions
- Rescued the ::encode and ::decode funtions and put them in util.cpp.
  This is because 2.0 will still need to perform the same encode/decode
  operations without Att.cpp around.
2011-08-27 10:21:49 -04:00
Paul Beckingham
f92b13fbf7 Visuals
- Cleaned up 'info' command output when the task is not pending and
  has no ID.  It displays '-' instead of the misleading "0".
2011-08-26 02:41:51 -04:00
Paul Beckingham
64be6e1cf4 Unit Tests
- Added unit tests for bug 819, on behalf of Matt Kraai.
- Created a new, single test for cleanup that replaces 6.  It's makes
  for shorter unit tests, and adds less test count inflation.  Over
  time, all tests should be modified in a similar way.  This will
  probably cut the total number of unit tests in half, but that's not
  the important metric.
2011-08-26 02:13:32 -04:00
Matt Kraai
ea3f0e8567 Bug #819
- Patch applied to fix problem with parsing, where this:
    aa'a
  is parsed as
    aa 'a

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2011-08-26 02:00:41 -04:00
Paul Beckingham
e127f33e3a TDB2::siblings
- TDB2 helper function to locate sibling tasks.
2011-08-26 01:58:07 -04:00
Paul Beckingham
4f0276c062 DOM
- Implemented lookup for <id>.<attr> and <uuid>.<attr>.
2011-08-25 22:19:25 -04:00
Paul Beckingham
60ca284e3a TDB2::get
- Implemented high-level accessors for tasks, by ID and UUID.  This
  permits full DOM implementation.
2011-08-25 22:13:47 -04:00
Paul Beckingham
dab06f8672 Code Cleanup
- All objects now use the same convention for naming members.  The
  consistency is a good thing.
2011-08-25 21:54:28 -04:00
Paul Beckingham
fb6dc5058f TDB2
- Full implementation of TDB2::add, which includes pending/completed, undo
  and backlog.
- Removed obsolete TF2::commitUndo, which is no longer necessary.
- Added File::truncate method, to allow a TDB2 shortcut.
2011-08-25 00:29:54 -04:00
Paul Beckingham
02df3853f7 Unit Tests
- Fixed more unit tests that were out of synch with the latest
  functionality, text messages or rendering.
2011-08-24 00:47:44 -04:00
Paul Beckingham
6f38e10cab Feature #682
- Added feature #682, which allows the configuration variable 'defaultheight'
  to override the assumed height of 24 lines when 'detection' is not enabled
  (thanks to Steve Rader).
2011-08-23 23:29:36 -04:00
Paul Beckingham
397d1c2d09 Feature #806
- Added feature #806, which provides the ability to compare dates using the
  relational operator '>=' (thanks to Miguel de Val Borro).
2011-08-23 23:01:56 -04:00
Paul Beckingham
257f5ab3da Bug #458
- Fixed bug #458, removing the ambiguous 'm' as a duration, leaving 'mi[nutes]'
  and 'mo[nths]' requiring at least two characters for a match.
2011-08-23 22:46:32 -04:00
Paul Beckingham
d15cccdb7d Bug #694
- Fixed bug #694, which allows attributes to be modified while annotating a
  task (thanks to Aikido Guy).
2011-08-23 22:30:01 -04:00
Paul Beckingham
2f60bdf9d0 Bug #720
- Fixed bug #720, so that when the 'info' report renders total active time,
  it uses a lossless format (thanks to Bernhard B).
2011-08-23 22:15:00 -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
2e09ddd900 Unit Tests
- Fixed some tests that used old message text.
- Fixed tests that relied on 'log'ed tasks still being written into
  pending.data.
- Removed obsolete auto-info tests.
2011-08-23 20:12:19 -04:00
Paul Beckingham
9641dde54f Debug Mode
- No longer generates parsing diagrams if debug mode is off.
2011-08-23 07:14:26 -04:00
Paul Beckingham
1dc2257156 TDB2 Conversion
- Migrated several commands over to use TDB2.  Have to start somewhere.
2011-08-23 00:47:46 -04:00
Paul Beckingham
e573801517 TDB2 - Diagnostics
- Added a diagnostic dump of the TDB2 state in debug mode.
- Added a call to TDB2::dump at the start of TDB2::commit.
- Removed unnecessary calls to TDB2::dump.
2011-08-22 23:04:38 -04:00
Paul Beckingham
013061803f Helper Functions
- Implemented rightJustifyZero for zero-padded integer strings.
2011-08-22 22:24:43 -04:00
Paul Beckingham
589627852f Duration Bug
- Removed the unnecessary ::getInt parse before ::getNumber, which was
  causing "-1.2d" to not parse.
- Removed verbose debug statement.
2011-08-21 23:32:37 -04:00
Paul Beckingham
6ed2bcd605 Durations
- Removed support for ' 1 wk', namely spaces before and after the ordinal.
  This removes (some) ambiguity in more complex command lines.
- Fixed unit tests accordingly.
2011-08-21 23:19:10 -04:00
Paul Beckingham
501953a6da TDB2
- Verifies that a UUID is not already found in the data.  This prevents
  erroneous double-import.  Or triple...
2011-08-21 22:37:02 -04:00
Paul Beckingham
d7ba2b2b62 Portability
- Fixed compiler warning.
2011-08-21 22:36:11 -04:00
Paul Beckingham
7a778ba317 E9 operator_equal
- Fixed broken logic in operator_equal.
- Fixed typos in op_and.t unit test.
- Fixed descriptions in op_or.t.
2011-08-21 18:38:04 -04:00
Paul Beckingham
e0ecb7a2d8 E9 - Relational Operators
- Added missing-data handling for the relational operators <, <=, >
  and >=.
2011-08-21 16:54:50 -04:00
Paul Beckingham
f11c8ee5c6 Unit Tests
- Added unit tests for the '<=' and '>=' operators.  All tests pass,
  which makes a nice treat.
- Added more tests to '<' and '>' operators, so that all three data
  types are covered.
2011-08-21 16:45:38 -04:00
Paul Beckingham
a4fca31e7d Unit Tests
- Added unit tests for the '<' and '>' operators.  Many fail.  Sigh.
2011-08-21 16:28:01 -04:00
Paul Beckingham
ee42f9898f Unit Tests
- Added unit tests for the 'and', 'or' and 'xor' operators.  Many of
  them fail.  As expected.
2011-08-21 15:59:47 -04:00
Paul Beckingham
788eea8d80 E9 operator_not
- Corrected the implementation of the ! operator, which was previously
  doing ... nothing.
2011-08-21 15:38:07 -04:00
Paul Beckingham
6e976e7d7c E9 - operator_equal
- Added proper handling for missing dates to the '=' operator.  This
  is a trial run of enhancements to lots of other operators to come.
2011-08-21 14:33:10 -04:00
Paul Beckingham
2b961c128a DEVELOPER File
- Added some clarification, minor changes.
2011-08-21 14:31:49 -04:00
Paul Beckingham
de9dbbbb3d A3, Arg
- Some attribute values (ie wait:tomorrow) when parsed, need to take
  the data type of the attribute (date) and use that as an implied type
  of the value (date literal).
- Arg renders type-less and category-less values as "", instead of "none".
  Cleaner output.
2011-08-21 14:24:26 -04:00
Paul Beckingham
a3ba91c2a3 Recurrence
- Recurrence values are now stored in a parsed state, and rendered by
  Duration::formatCompact.
2011-08-21 13:43:54 -04:00
Paul Beckingham
1714601ce4 Duration
- Allowed durations to be specified numerically as seconds, in string form.
  This flexibility allows the removal of special-case handling that stores
  recurrence periods in raw form ('monthly'), reducing code size.  As a
  consequence this means that recurrence may now be rendered according to
  Duration::formatCompact, which is desirable.
- Added supporting unit tests.
2011-08-21 13:32:55 -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
1b55a48757 Unit Tests
- Eliminated obsolete benchmark.t.
- Removed the 'quick' mode logic to skip benchmarks in run_all.
- Restored bug.480.t tests that hung earlier.
2011-08-21 01:09:32 -04:00
Paul Beckingham
7aa4efef8d Expression Refactor
- Refactoring complete.  Arg objects now uses enumerations for _type
  and _category, which should help with performance.
2011-08-21 01:06:50 -04:00
Paul Beckingham
9086f51d29 Merge branch '2.0.0' of tasktools.org:task into 2.0.0 2011-08-20 17:09:04 -04:00
Paul Beckingham
215364958e Expressions Refactor - Clarified expansion rules
- Arg now has a _value member that reflects the value in play, rather
  than the input _raw value.  Only _value is used in eval.
- DOM expansion capabilities are now controlled by rc.dom.
2011-08-20 17:06:50 -04:00
Federico Hernandez
556ee1165d Portability
Added a reference to the Darwin 32bit version task to the task-faq
man page as well.
2011-08-20 23:01:47 +02:00
Paul Beckingham
c6229a6ca6 Unit Tests
- Removed benchmark2.t - it is no longer useful, and duplicates benchmark.t,
  which is itself not long for this world.
2011-08-20 14:56:09 -04:00
Paul Beckingham
438e65036b Expression Refactor
- Arguments are now categorized as either "literal" or a specific
  category, with accompanying type.  Type is inferred for literals,
  and referenced for attributes.
2011-08-20 14:02:48 -04:00