MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / measure

Method measure

src/columns/ColProject.cpp:53–68  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Set the minimum and maximum widths for the value.

Source from the content-addressed store, hash-verified

51////////////////////////////////////////////////////////////////////////////////
52// Set the minimum and maximum widths for the value.
53void ColumnProject::measure(Task& task, unsigned int& minimum, unsigned int& maximum) {
54 minimum = maximum = 0;
55 if (task.has(_name)) {
56 std::string project = task.get(_name);
57
58 if (_style == "parent") {
59 auto period = project.find('.');
60 if (period != std::string::npos) project = project.substr(0, period);
61 } else if (_style == "indented") {
62 project = indentProject(project, " ", '.');
63 }
64
65 minimum = longestWord(project);
66 maximum = utf8_width(project);
67 }
68}
69
70////////////////////////////////////////////////////////////////////////////////
71void ColumnProject::render(std::vector<std::string>& lines, Task& task, int width, Color& color) {

Callers

nothing calls this directly

Calls 4

indentProjectFunction · 0.85
findMethod · 0.80
hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected