mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Priority: Converted 'priority' attribute to a UDA
- 'priority.long' and 'priority.short' formats now map to 'priority', and generate a warning. - Man page updated. - Converted priority urgency coefficients to UDA equivalents. - Converted priority color rules to UDA color rules. - Removed 'default.priority' support. - Removed special sort handling for 'priority' field in Variant, added special UDA sort handling. - Removed ColPriority.{h,cpp} source files. - Removed asorted newly-unused variables. - The 'show' command now highlights unused priority settings. - Removed unused localized priority-relateѕ strings. - Added legacy mapping for columns and sort columns for 'priority.long' and 'priority.short' columns in report definitions. - Removed priority color rules implementation. - Removed obsolete tests for #860, #990, custom.priority_long.t. - Updated various tests that set priority default, colors.
This commit is contained in:
parent
7a9d314016
commit
5af4579741
33 changed files with 102 additions and 630 deletions
|
@ -206,8 +206,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
<< "# Status: " << ucFirst (Task::statusToText (task.getStatus ())) << "\n" // L10N safe ucFirst.
|
||||
<< "# Mask: " << task.get ("mask") << "\n"
|
||||
<< "# iMask: " << task.get ("imask") << "\n"
|
||||
<< " Project: " << task.get ("project") << "\n"
|
||||
<< " Priority: " << task.get ("priority") << "\n";
|
||||
<< " Project: " << task.get ("project") << "\n";
|
||||
|
||||
std::vector <std::string> tags;
|
||||
task.getTags (tags);
|
||||
|
@ -343,25 +342,6 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string
|
|||
}
|
||||
}
|
||||
|
||||
// priority
|
||||
value = findValue (after, "\n Priority:");
|
||||
if (task.get ("priority") != value)
|
||||
{
|
||||
if (value != "")
|
||||
{
|
||||
if (context.columns["priority"]->validate (value))
|
||||
{
|
||||
context.footnote (STRING_EDIT_PRIORITY_MOD);
|
||||
task.set ("priority", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
context.footnote (STRING_EDIT_PRIORITY_DEL);
|
||||
task.remove ("priority");
|
||||
}
|
||||
}
|
||||
|
||||
// tags
|
||||
value = findValue (after, "\n Tags:");
|
||||
std::vector <std::string> tags;
|
||||
|
|
|
@ -150,14 +150,6 @@ int CmdInfo::execute (std::string& output)
|
|||
view.set (row, 1, task->get ("project"));
|
||||
}
|
||||
|
||||
// priority
|
||||
if (task->has ("priority"))
|
||||
{
|
||||
row = view.addRow ();
|
||||
view.set (row, 0, STRING_COLUMN_LABEL_PRIORITY);
|
||||
view.set (row, 1, task->get ("priority"));
|
||||
}
|
||||
|
||||
// dependencies: blocked
|
||||
{
|
||||
std::vector <Task> blocked;
|
||||
|
@ -420,7 +412,6 @@ int CmdInfo::execute (std::string& output)
|
|||
urgencyDetails.add (Column::factory ("string", "")); // Result
|
||||
|
||||
urgencyTerm (urgencyDetails, "project", task->urgency_project (), Task::urgencyProjectCoefficient);
|
||||
urgencyTerm (urgencyDetails, "priority", task->urgency_priority (), Task::urgencyPriorityCoefficient);
|
||||
urgencyTerm (urgencyDetails, "active", task->urgency_active (), Task::urgencyActiveCoefficient);
|
||||
urgencyTerm (urgencyDetails, "scheduled", task->urgency_scheduled (), Task::urgencyScheduledCoefficient);
|
||||
urgencyTerm (urgencyDetails, "waiting", task->urgency_waiting (), Task::urgencyWaitingCoefficient);
|
||||
|
|
|
@ -82,7 +82,6 @@ int CmdProjects::execute (std::string& output)
|
|||
std::map <std::string, int> unique;
|
||||
bool no_project = false;
|
||||
std::string project;
|
||||
std::string priority;
|
||||
std::vector <Task>::iterator task;
|
||||
for (task = filtered.begin (); task != filtered.end (); ++task)
|
||||
{
|
||||
|
|
|
@ -142,7 +142,6 @@ int CmdShow::execute (std::string& output)
|
|||
" debug.tls"
|
||||
" default.command"
|
||||
" default.due"
|
||||
" default.priority"
|
||||
" default.project"
|
||||
" defaultheight"
|
||||
" defaultwidth"
|
||||
|
@ -200,7 +199,6 @@ int CmdShow::execute (std::string& output)
|
|||
" urgency.inherit.coefficient"
|
||||
" urgency.due.coefficient"
|
||||
" urgency.next.coefficient"
|
||||
" urgency.priority.coefficient"
|
||||
" urgency.project.coefficient"
|
||||
" urgency.tags.coefficient"
|
||||
" urgency.waiting.coefficient"
|
||||
|
@ -367,15 +365,6 @@ int CmdShow::execute (std::string& output)
|
|||
out << format (STRING_CMD_SHOW_CONFIG_ERROR, "calendar.holidays", calendarholidays)
|
||||
<< "\n";
|
||||
|
||||
// Check for bad values in rc.default.priority.
|
||||
std::string defaultPriority = context.config.get ("default.priority");
|
||||
if (defaultPriority != "H" &&
|
||||
defaultPriority != "M" &&
|
||||
defaultPriority != "L" &&
|
||||
defaultPriority != "")
|
||||
out << format (STRING_CMD_SHOW_CONFIG_ERROR, "default.priority", defaultPriority)
|
||||
<< "\n";
|
||||
|
||||
// Verify installation. This is mentioned in the documentation as the way
|
||||
// to ensure everything is properly installed.
|
||||
|
||||
|
|
|
@ -86,7 +86,6 @@
|
|||
|
||||
#include <Context.h>
|
||||
#include <ColProject.h>
|
||||
#include <ColPriority.h>
|
||||
#include <ColDue.h>
|
||||
|
||||
extern Context context;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue