mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug
- Import was not properly handling tags as a JSON array. It assumed it was a string. - Modified roundtrip.t tests so they work.
This commit is contained in:
parent
6ab7cec36c
commit
de5bee4353
2 changed files with 42 additions and 24 deletions
|
@ -123,6 +123,20 @@ int CmdImport::execute (std::string& output)
|
|||
task.set (i->first, d.toEpochString ());
|
||||
}
|
||||
|
||||
// Tags are an array of JSON strings.
|
||||
else if (i->first == "tags")
|
||||
{
|
||||
json::array* tags = (json::array*)i->second;
|
||||
json_array_iter t;
|
||||
for (t = tags->_data.begin ();
|
||||
t != tags->_data.end ();
|
||||
++t)
|
||||
{
|
||||
json::string* tag = (json::string*)*t;
|
||||
task.addTag (tag->_data);
|
||||
}
|
||||
}
|
||||
|
||||
// Other types are simply added.
|
||||
else
|
||||
task.set (i->first, unquoteText (i->second->dump ()));
|
||||
|
@ -158,6 +172,21 @@ int CmdImport::execute (std::string& output)
|
|||
task.setAnnotations (annos);
|
||||
}
|
||||
|
||||
// TODO Implement
|
||||
else if (i->first == "parent")
|
||||
{
|
||||
}
|
||||
|
||||
// TODO Implement
|
||||
else if (i->first == "mask")
|
||||
{
|
||||
}
|
||||
|
||||
// TODO Implement
|
||||
else if (i->first == "imask")
|
||||
{
|
||||
}
|
||||
|
||||
else
|
||||
throw std::string ("Unrecognized attribute '") + i->first + "'";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue