mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
C++11: Cleaned up program framework with range-based for
This commit is contained in:
parent
5a57dfd70d
commit
e74c6963a9
28 changed files with 937 additions and 1221 deletions
|
@ -60,9 +60,8 @@ ViewTask::ViewTask ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
ViewTask::~ViewTask ()
|
||||
{
|
||||
std::vector <Column*>::iterator i;
|
||||
for (i = _columns.begin (); i != _columns.end (); ++i)
|
||||
delete *i;
|
||||
for (auto& col : _columns)
|
||||
delete col;
|
||||
|
||||
_columns.clear ();
|
||||
}
|
||||
|
@ -297,7 +296,6 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
// Compose, render columns, in sequence.
|
||||
_rows = 0;
|
||||
std::vector <std::vector <std::string>> cells;
|
||||
std::vector <int>::iterator s;
|
||||
for (unsigned int s = 0; s < sequence.size (); ++s)
|
||||
{
|
||||
max_lines = 0;
|
||||
|
@ -334,10 +332,9 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
if (s > 0 &&
|
||||
_breaks.size () > 0)
|
||||
{
|
||||
std::vector <std::string>::iterator b;
|
||||
for (b = _breaks.begin (); b != _breaks.end (); ++b)
|
||||
for (auto& b : _breaks)
|
||||
{
|
||||
if (data[sequence[s - 1]].get (*b) != data[sequence[s]].get (*b))
|
||||
if (data[sequence[s - 1]].get (b) != data[sequence[s]].get (b))
|
||||
{
|
||||
out += "\n";
|
||||
++_lines;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue