mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
- Fixed bug #822, #845, which generated incorrect IDs (thanks to Matt Kraai and Michelle Crane).
This commit is contained in:
parent
a99aa217d0
commit
87d940c46d
3 changed files with 19 additions and 3 deletions
|
@ -188,6 +188,8 @@
|
|||
(thanks to Owen Clarke).
|
||||
+ Fixed bug #808, which generated compiler warnings on Solarix (thanks to
|
||||
Owen Clarke).
|
||||
+ Fixed bug #822, #845, which generated incorrect IDs (thanks to Matt Kraai and
|
||||
Michelle Crane).
|
||||
+ Fixed bug #831, which prevented some date fields from being properly parsed.
|
||||
+ Fixed bug #835, which prevented hierarchical projects from being recognized.
|
||||
+ Fixed bug #839, which caused problems when recurrence frequencies of '1m'
|
||||
|
|
18
src/TDB2.cpp
18
src/TDB2.cpp
|
@ -64,6 +64,7 @@ TF2::TF2 ()
|
|||
, _loaded_tasks (false)
|
||||
, _loaded_lines (false)
|
||||
, _loaded_contents (false)
|
||||
, _has_ids (false)
|
||||
, _contents ("")
|
||||
{
|
||||
}
|
||||
|
@ -300,8 +301,10 @@ void TF2::load_tasks ()
|
|||
++line_number;
|
||||
Task task (*i);
|
||||
|
||||
// Every task gets an ID.
|
||||
task.id = context.tdb2.next_id ();
|
||||
// Some tasks gets an ID.
|
||||
if (_has_ids)
|
||||
task.id = context.tdb2.next_id ();
|
||||
|
||||
_tasks.push_back (task);
|
||||
|
||||
// Maintain mapping for ease of link/dependency resolution.
|
||||
|
@ -399,6 +402,12 @@ int TF2::id (const std::string& uuid)
|
|||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TF2::has_ids ()
|
||||
{
|
||||
_has_ids = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Completely wipe it all clean.
|
||||
void TF2::clear ()
|
||||
|
@ -411,8 +420,9 @@ void TF2::clear ()
|
|||
|
||||
_contents = "";
|
||||
|
||||
// Note that the actual file name is deliberately not cleared.
|
||||
// Note that the actual file name, and _has_ids are deliberately not cleared.
|
||||
//_file._data = "";
|
||||
//_has_ids = false;
|
||||
|
||||
_tasks.clear ();
|
||||
_added_tasks.clear ();
|
||||
|
@ -481,6 +491,8 @@ TDB2::TDB2 ()
|
|||
: _location ("")
|
||||
, _id (1)
|
||||
{
|
||||
// Mark the pending file as the only one that has ID numbers.
|
||||
pending.has_ids ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
std::string uuid (int);
|
||||
int id (const std::string&);
|
||||
|
||||
void has_ids ();
|
||||
void clear ();
|
||||
const std::string dump ();
|
||||
|
||||
|
@ -72,6 +73,7 @@ public:
|
|||
bool _loaded_tasks;
|
||||
bool _loaded_lines;
|
||||
bool _loaded_contents;
|
||||
bool _has_ids;
|
||||
std::vector <Task> _tasks;
|
||||
std::vector <Task> _added_tasks;
|
||||
std::vector <Task> _modified_tasks;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue