libhsared: migrating from local to libshared
This commit is contained in:
@@ -28,7 +28,8 @@
|
||||
#include <ColDepends.h>
|
||||
#include <algorithm>
|
||||
#include <Context.h>
|
||||
#include <text.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <utf8.h>
|
||||
#include <i18n.h>
|
||||
#include <main.h>
|
||||
@@ -91,8 +92,7 @@ void ColumnDepends::measure (Task& task, unsigned int& minimum, unsigned int& ma
|
||||
for (auto& i : blocking)
|
||||
blocking_ids.push_back (i.id);
|
||||
|
||||
std::string all;
|
||||
join (all, " ", blocking_ids);
|
||||
auto all = join (" ", blocking_ids);
|
||||
maximum = all.length ();
|
||||
|
||||
unsigned int length;
|
||||
@@ -134,8 +134,7 @@ void ColumnDepends::render (
|
||||
for (const auto& t : blocking)
|
||||
blocking_ids.push_back (t.id);
|
||||
|
||||
std::string combined;
|
||||
join (combined, " ", blocking_ids);
|
||||
auto combined = join (" ", blocking_ids);
|
||||
|
||||
std::vector <std::string> all;
|
||||
wrapText (all, combined, width, _hyphenate);
|
||||
@@ -150,12 +149,8 @@ void ColumnDepends::render (
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ColumnDepends::modify (Task& task, const std::string& value)
|
||||
{
|
||||
// Parse IDs
|
||||
std::vector <std::string> deps;
|
||||
split (deps, value, ',');
|
||||
|
||||
// Apply or remove dendencies in turn.
|
||||
for (auto& dep : deps)
|
||||
for (auto& dep : split (value, ','))
|
||||
{
|
||||
if (dep[0] == '-')
|
||||
{
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <Context.h>
|
||||
#include <ISO8601.h>
|
||||
#include <text.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <utf8.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <cmake.h>
|
||||
#include <ColID.h>
|
||||
#include <math.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <cmake.h>
|
||||
#include <ColIMask.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <cmake.h>
|
||||
#include <ColMask.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <cmake.h>
|
||||
#include <ColParent.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
#include <Lexer.h>
|
||||
#include <Filter.h>
|
||||
#include <Dates.h>
|
||||
#include <text.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <utf8.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
#include <Lexer.h>
|
||||
#include <Filter.h>
|
||||
#include <Dates.h>
|
||||
#include <text.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <utf8.h>
|
||||
#include <i18n.h>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <cmake.h>
|
||||
#include <ColStatus.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
#include <utf8.h>
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <cmake.h>
|
||||
#include <ColString.h>
|
||||
#include <Context.h>
|
||||
#include <format.h>
|
||||
#include <shared.h>
|
||||
#include <text.h>
|
||||
#include <i18n.h>
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
#include <Variant.h>
|
||||
#include <Filter.h>
|
||||
#include <Dates.h>
|
||||
#include <text.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
#include <utf8.h>
|
||||
#include <main.h>
|
||||
@@ -96,8 +97,7 @@ void ColumnTags::measure (Task& task, unsigned int& minimum, unsigned int& maxim
|
||||
// Find the widest tag.
|
||||
if (tags.find (',') != std::string::npos)
|
||||
{
|
||||
std::vector <std::string> all;
|
||||
split (all, tags, ',');
|
||||
auto all = split (tags, ',');
|
||||
for (const auto& tag : all)
|
||||
{
|
||||
auto length = utf8_width (tag);
|
||||
@@ -132,10 +132,9 @@ void ColumnTags::render (
|
||||
{
|
||||
if (tags.find (',') != std::string::npos)
|
||||
{
|
||||
std::vector <std::string> all;
|
||||
split (all, tags, ',');
|
||||
auto all = split (tags, ',');
|
||||
std::sort (all.begin (), all.end ());
|
||||
join (tags, " ", all);
|
||||
tags = join (" ", all);
|
||||
|
||||
all.clear ();
|
||||
wrapText (all, tags, width, _hyphenate);
|
||||
@@ -152,8 +151,7 @@ void ColumnTags::render (
|
||||
}
|
||||
else if (_style == "count")
|
||||
{
|
||||
std::vector <std::string> all;
|
||||
split (all, tags, ',');
|
||||
auto all = split (tags, ',');
|
||||
renderStringRight (lines, width, color, '[' + format (static_cast <int> (all.size ())) + ']');
|
||||
}
|
||||
}
|
||||
@@ -167,10 +165,7 @@ void ColumnTags::modify (Task& task, const std::string& value)
|
||||
// TW-1701
|
||||
task.set ("tags", "");
|
||||
|
||||
std::vector <std::string> tags;
|
||||
split (tags, value, ',');
|
||||
|
||||
for (auto& tag : tags)
|
||||
for (auto& tag : split (value, ','))
|
||||
{
|
||||
// If it's a DOM ref, eval it first.
|
||||
Lexer lexer (tag);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <Variant.h>
|
||||
#include <Filter.h>
|
||||
#include <Dates.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <Variant.h>
|
||||
#include <Filter.h>
|
||||
#include <Dates.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <Variant.h>
|
||||
#include <Filter.h>
|
||||
#include <Dates.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <Variant.h>
|
||||
#include <Filter.h>
|
||||
#include <Dates.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
#include <ColUDA.h>
|
||||
#include <Context.h>
|
||||
#include <ISO8601.h>
|
||||
#include <text.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <utf8.h>
|
||||
#include <i18n.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <cmake.h>
|
||||
#include <ColUUID.h>
|
||||
#include <math.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <cmake.h>
|
||||
#include <ColUrgency.h>
|
||||
#include <text.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
#include <ColUUID.h>
|
||||
#include <ColUDA.h>
|
||||
#include <ColWait.h>
|
||||
#include <text.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
@@ -186,7 +187,7 @@ Column* Column::uda (const std::string& name)
|
||||
c->_name = name;
|
||||
c->_label = label;
|
||||
if (values != "")
|
||||
split (c->_values, values, ',');
|
||||
c->_values = split (values, ',');
|
||||
return c;
|
||||
}
|
||||
else if (type == "numeric")
|
||||
@@ -195,7 +196,7 @@ Column* Column::uda (const std::string& name)
|
||||
c->_name = name;
|
||||
c->_label = label;
|
||||
if (values != "")
|
||||
split (c->_values, values, ',');
|
||||
c->_values = split (values, ',');
|
||||
return c;
|
||||
}
|
||||
else if (type == "date")
|
||||
@@ -204,7 +205,7 @@ Column* Column::uda (const std::string& name)
|
||||
c->_name = name;
|
||||
c->_label = label;
|
||||
if (values != "")
|
||||
split (c->_values, values, ',');
|
||||
c->_values = split (values, ',');
|
||||
return c;
|
||||
}
|
||||
else if (type == "duration")
|
||||
@@ -213,7 +214,7 @@ Column* Column::uda (const std::string& name)
|
||||
c->_name = name;
|
||||
c->_label = label;
|
||||
if (values != "")
|
||||
split (c->_values, values, ',');
|
||||
c->_values = split (values, ',');
|
||||
return c;
|
||||
}
|
||||
else if (type != "")
|
||||
|
||||
Reference in New Issue
Block a user