mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Portability: Updated to make main re-entrant()
- New INSTALL instructions to emscripten, and AUTHORS for contribution.
This commit is contained in:
parent
cae3f06b7d
commit
7af6db4c17
112 changed files with 960 additions and 1147 deletions
|
@ -33,8 +33,6 @@
|
|||
#include <utf8.h>
|
||||
#include <main.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ViewTask::ViewTask ()
|
||||
: _width (0)
|
||||
|
@ -112,8 +110,8 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
{
|
||||
Timer timer;
|
||||
|
||||
bool const obfuscate = context.config.getBoolean ("obfuscate");
|
||||
bool const print_empty_columns = context.config.getBoolean ("print.empty.columns");
|
||||
bool const obfuscate = Context::getContext ().config.getBoolean ("obfuscate");
|
||||
bool const print_empty_columns = Context::getContext ().config.getBoolean ("print.empty.columns");
|
||||
std::vector <Column*> nonempty_columns;
|
||||
std::vector <bool> nonempty_sort;
|
||||
|
||||
|
@ -190,11 +188,11 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
|
||||
// Calculate final column widths.
|
||||
int overage = _width - sum_minimal - all_extra;
|
||||
context.debug (format ("ViewTask::render min={1} ideal={2} overage={3} width={4}",
|
||||
sum_minimal + all_extra,
|
||||
sum_ideal + all_extra,
|
||||
overage,
|
||||
_width));
|
||||
Context::getContext ().debug (format ("ViewTask::render min={1} ideal={2} overage={3} width={4}",
|
||||
sum_minimal + all_extra,
|
||||
sum_ideal + all_extra,
|
||||
overage,
|
||||
_width));
|
||||
|
||||
std::vector <int> widths;
|
||||
|
||||
|
@ -207,7 +205,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
// Not enough for minimum.
|
||||
else if (overage < 0)
|
||||
{
|
||||
context.error (format ("The report has a minimum width of {1} and does not fit in the available width of {2}.", sum_minimal + all_extra, _width));
|
||||
Context::getContext ().error (format ("The report has a minimum width of {1} and does not fit in the available width of {2}.", sum_minimal + all_extra, _width));
|
||||
widths = minimal;
|
||||
}
|
||||
|
||||
|
@ -256,10 +254,10 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
std::string extra = std::string (_extra_padding, ' ');
|
||||
std::string intra = std::string (_intra_padding, ' ');
|
||||
|
||||
std::string extra_odd = context.color () ? _extra_odd.colorize (extra) : extra;
|
||||
std::string extra_even = context.color () ? _extra_even.colorize (extra) : extra;
|
||||
std::string intra_odd = context.color () ? _intra_odd.colorize (intra) : intra;
|
||||
std::string intra_even = context.color () ? _intra_even.colorize (intra) : intra;
|
||||
std::string extra_odd = Context::getContext ().color () ? _extra_odd.colorize (extra) : extra;
|
||||
std::string extra_even = Context::getContext ().color () ? _extra_even.colorize (extra) : extra;
|
||||
std::string intra_odd = Context::getContext ().color () ? _intra_odd.colorize (intra) : intra;
|
||||
std::string intra_even = Context::getContext ().color () ? _intra_even.colorize (intra) : intra;
|
||||
|
||||
std::string out;
|
||||
_lines = 0;
|
||||
|
@ -287,7 +285,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
// Stop if the line limit is exceeded.
|
||||
if (++_lines >= _truncate_lines && _truncate_lines != 0)
|
||||
{
|
||||
context.time_render_us += timer.total_us ();
|
||||
Context::getContext ().time_render_us += timer.total_us ();
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +304,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
// Alternate rows based on |s % 2|
|
||||
bool odd = (s % 2) ? true : false;
|
||||
Color row_color;
|
||||
if (context.color ())
|
||||
if (Context::getContext ().color ())
|
||||
{
|
||||
row_color = odd ? _odd : _even;
|
||||
row_color.blend (rule_color);
|
||||
|
@ -373,7 +371,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
// Stop if the line limit is exceeded.
|
||||
if (++_lines >= _truncate_lines && _truncate_lines != 0)
|
||||
{
|
||||
context.time_render_us += timer.total_us ();
|
||||
Context::getContext ().time_render_us += timer.total_us ();
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
@ -383,12 +381,12 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
// Stop if the row limit is exceeded.
|
||||
if (++_rows >= _truncate_rows && _truncate_rows != 0)
|
||||
{
|
||||
context.time_render_us += timer.total_us ();
|
||||
Context::getContext ().time_render_us += timer.total_us ();
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
context.time_render_us += timer.total_us ();
|
||||
Context::getContext ().time_render_us += timer.total_us ();
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue