mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +02:00
Use the correct formatting for tag_
properties (#3261)
This resolves a discrepancy between Taskwarrior and Taskchampion as to how tags should be represented.
This commit is contained in:
parent
00a3b6edc2
commit
5b5a7a37c0
1 changed files with 4 additions and 4 deletions
|
@ -1537,7 +1537,7 @@ void Task::removeTag (const std::string& tag)
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Task::fixTagsAttribute ()
|
void Task::fixTagsAttribute ()
|
||||||
{
|
{
|
||||||
// Fix up the old `tags` attribute to match the `tags_..` attributes (or
|
// Fix up the old `tags` attribute to match the `tag_..` attributes (or
|
||||||
// remove it if there are no tags)
|
// remove it if there are no tags)
|
||||||
auto tags = getTags ();
|
auto tags = getTags ();
|
||||||
if (tags.size () > 0) {
|
if (tags.size () > 0) {
|
||||||
|
@ -1550,14 +1550,14 @@ void Task::fixTagsAttribute ()
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool Task::isTagAttr(const std::string& attr)
|
bool Task::isTagAttr(const std::string& attr)
|
||||||
{
|
{
|
||||||
return attr.compare(0, 5, "tags_") == 0;
|
return attr.compare(0, 4, "tag_") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
const std::string Task::tag2Attr (const std::string& tag) const
|
const std::string Task::tag2Attr (const std::string& tag) const
|
||||||
{
|
{
|
||||||
std::stringstream tag_attr;
|
std::stringstream tag_attr;
|
||||||
tag_attr << "tags_" << tag;
|
tag_attr << "tag_" << tag;
|
||||||
return tag_attr.str();
|
return tag_attr.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1565,7 +1565,7 @@ const std::string Task::tag2Attr (const std::string& tag) const
|
||||||
const std::string Task::attr2Tag (const std::string& attr) const
|
const std::string Task::attr2Tag (const std::string& attr) const
|
||||||
{
|
{
|
||||||
assert (isTagAttr (attr));
|
assert (isTagAttr (attr));
|
||||||
return attr.substr(5);
|
return attr.substr(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue