Merge branch 'recurrence' into 2.6.0
This commit is contained in:
@@ -40,16 +40,17 @@ extern Context context;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ColumnDescription::ColumnDescription ()
|
||||
{
|
||||
_name = "description";
|
||||
_style = "combined";
|
||||
_label = STRING_COLUMN_LABEL_DESC;
|
||||
_name = "description";
|
||||
_style = "combined";
|
||||
_label = STRING_COLUMN_LABEL_DESC;
|
||||
_modifiable = true;
|
||||
|
||||
_styles = {"combined",
|
||||
"desc",
|
||||
"oneline",
|
||||
"truncated",
|
||||
"count",
|
||||
"truncated_count"};
|
||||
_styles = {"combined",
|
||||
"desc",
|
||||
"oneline",
|
||||
"truncated",
|
||||
"count",
|
||||
"truncated_count"};
|
||||
|
||||
_dateformat = context.config.get ("dateformat.annotation");
|
||||
if (_dateformat == "")
|
||||
@@ -101,9 +102,7 @@ void ColumnDescription::measure (Task& task, unsigned int& minimum, unsigned int
|
||||
if (min_anno > minimum)
|
||||
minimum = min_anno;
|
||||
|
||||
std::map <std::string, std::string> annos;
|
||||
task.getAnnotations (annos);
|
||||
for (auto& i : annos)
|
||||
for (auto& i : task.getAnnotations ())
|
||||
{
|
||||
unsigned int len = min_anno + 1 + utf8_width (i.second);
|
||||
if (len > maximum)
|
||||
@@ -128,9 +127,7 @@ void ColumnDescription::measure (Task& task, unsigned int& minimum, unsigned int
|
||||
if (task.annotation_count)
|
||||
{
|
||||
auto min_anno = Datetime::length (_dateformat);
|
||||
std::map <std::string, std::string> annos;
|
||||
task.getAnnotations (annos);
|
||||
for (auto& i : annos)
|
||||
for (auto& i : task.getAnnotations ())
|
||||
maximum += min_anno + 1 + utf8_width (i.second);
|
||||
}
|
||||
}
|
||||
@@ -156,9 +153,6 @@ void ColumnDescription::measure (Task& task, unsigned int& minimum, unsigned int
|
||||
minimum = 4;
|
||||
maximum = utf8_width (description) + 1 + 1 + format (task.annotation_count).length () + 1;
|
||||
}
|
||||
|
||||
else
|
||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -178,9 +172,7 @@ void ColumnDescription::render (
|
||||
{
|
||||
if (task.annotation_count)
|
||||
{
|
||||
std::map <std::string, std::string> annos;
|
||||
task.getAnnotations (annos);
|
||||
for (const auto& i : annos)
|
||||
for (const auto& i : task.getAnnotations ())
|
||||
{
|
||||
Datetime dt (strtol (i.first.substr (11).c_str (), NULL, 10));
|
||||
description += '\n' + std::string (_indent, ' ') + dt.toString (_dateformat) + ' ' + i.second;
|
||||
@@ -209,9 +201,7 @@ void ColumnDescription::render (
|
||||
{
|
||||
if (task.annotation_count)
|
||||
{
|
||||
std::map <std::string, std::string> annos;
|
||||
task.getAnnotations (annos);
|
||||
for (const auto& i : annos)
|
||||
for (const auto& i : task.getAnnotations ())
|
||||
{
|
||||
Datetime dt (strtol (i.first.substr (11).c_str (), NULL, 10));
|
||||
description += ' ' + dt.toString (_dateformat) + ' ' + i.second;
|
||||
|
||||
Reference in New Issue
Block a user