mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-08 15:20:36 +02:00
Code Cleanup
- Removed priority counts from the 'projects' report.
This commit is contained in:
parent
b7760dc3ef
commit
292e0fb743
3 changed files with 3 additions and 19 deletions
|
@ -24,6 +24,7 @@ Features
|
||||||
+ Removed version 1.x column name support.
|
+ Removed version 1.x column name support.
|
||||||
+ Removed version 1.x sort column support.
|
+ Removed version 1.x sort column support.
|
||||||
+ Old-style color names including underscores are no longer supported.
|
+ Old-style color names including underscores are no longer supported.
|
||||||
|
+ Removed priority counts from the 'projects' report.
|
||||||
|
|
||||||
Bugs
|
Bugs
|
||||||
+ #1511 sync init crashes if client certification file is empty or invalid
|
+ #1511 sync init crashes if client certification file is empty or invalid
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -24,6 +24,7 @@ Removed features in 2.4.0
|
||||||
- Version 1.x column names no longer supported.
|
- Version 1.x column names no longer supported.
|
||||||
- Version 1.x sort columns no longer supported.
|
- Version 1.x sort columns no longer supported.
|
||||||
- Old-style color names including underscores are no longer supported.
|
- Old-style color names including underscores are no longer supported.
|
||||||
|
- Removed priority counts from the 'projects' commands.
|
||||||
|
|
||||||
Known Issues
|
Known Issues
|
||||||
|
|
||||||
|
|
|
@ -77,10 +77,6 @@ int CmdProjects::execute (std::string& output)
|
||||||
// Scan all the tasks for their project name, building a map using project
|
// Scan all the tasks for their project name, building a map using project
|
||||||
// names as keys.
|
// names as keys.
|
||||||
std::map <std::string, int> unique;
|
std::map <std::string, int> unique;
|
||||||
std::map <std::string, int> high;
|
|
||||||
std::map <std::string, int> medium;
|
|
||||||
std::map <std::string, int> low;
|
|
||||||
std::map <std::string, int> none;
|
|
||||||
bool no_project = false;
|
bool no_project = false;
|
||||||
std::string project;
|
std::string project;
|
||||||
std::string priority;
|
std::string priority;
|
||||||
|
@ -94,16 +90,10 @@ int CmdProjects::execute (std::string& output)
|
||||||
}
|
}
|
||||||
|
|
||||||
project = task->get ("project");
|
project = task->get ("project");
|
||||||
priority = task->get ("priority");
|
|
||||||
|
|
||||||
unique[project] += 1;
|
unique[project] += 1;
|
||||||
|
|
||||||
if (project == "")
|
if (project == "")
|
||||||
no_project = true;
|
no_project = true;
|
||||||
|
|
||||||
if (priority == "H") high[project] += 1;
|
|
||||||
else if (priority == "M") medium[project] += 1;
|
|
||||||
else if (priority == "L") low[project] += 1;
|
|
||||||
else none[project] += 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unique.size ())
|
if (unique.size ())
|
||||||
|
@ -113,10 +103,6 @@ int CmdProjects::execute (std::string& output)
|
||||||
view.width (context.getWidth ());
|
view.width (context.getWidth ());
|
||||||
view.add (Column::factory ("string", STRING_COLUMN_LABEL_PROJECT));
|
view.add (Column::factory ("string", STRING_COLUMN_LABEL_PROJECT));
|
||||||
view.add (Column::factory ("string.right", STRING_COLUMN_LABEL_TASKS));
|
view.add (Column::factory ("string.right", STRING_COLUMN_LABEL_TASKS));
|
||||||
view.add (Column::factory ("string.right", STRING_CMD_PROJECTS_PRI_N));
|
|
||||||
view.add (Column::factory ("string.right", STRING_CMD_PROJECTS_PRI_L));
|
|
||||||
view.add (Column::factory ("string.right", STRING_CMD_PROJECTS_PRI_M));
|
|
||||||
view.add (Column::factory ("string.right", STRING_CMD_PROJECTS_PRI_H));
|
|
||||||
|
|
||||||
std::vector <std::string> processed;
|
std::vector <std::string> processed;
|
||||||
std::map <std::string, int>::iterator project;
|
std::map <std::string, int>::iterator project;
|
||||||
|
@ -139,10 +125,6 @@ int CmdProjects::execute (std::string& output)
|
||||||
? STRING_CMD_PROJECTS_NONE
|
? STRING_CMD_PROJECTS_NONE
|
||||||
: indentProject (project->first, " ", '.')));
|
: indentProject (project->first, " ", '.')));
|
||||||
view.set (row, 1, project->second);
|
view.set (row, 1, project->second);
|
||||||
view.set (row, 2, none[project->first]);
|
|
||||||
view.set (row, 3, low[project->first]);
|
|
||||||
view.set (row, 4, medium[project->first]);
|
|
||||||
view.set (row, 5, high[project->first]);
|
|
||||||
processed.push_back (project->first);
|
processed.push_back (project->first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue