+ Fixed bug #783, which fixes completed and deleted tasks still showing as
  active (thanks to Adam Wolk).
This commit is contained in:
Paul Beckingham
2011-06-07 01:21:05 -04:00
parent 7c910e46be
commit 90f6f537fe
6 changed files with 21 additions and 29 deletions

View File

@@ -94,4 +94,5 @@ suggestions:
Uli Martens Uli Martens
Jonathan Hankins Jonathan Hankins
Andreas Kalex Andreas Kalex
Adam Wolk

View File

@@ -94,6 +94,8 @@
J. Pilkington). J. Pilkington).
+ Applied patch for Bug #771, which looks for libuuid if uuid_unparse_lower is + Applied patch for Bug #771, which looks for libuuid if uuid_unparse_lower is
not located (thanks to Christopher J. Pilkington). not located (thanks to Christopher J. Pilkington).
+ Fixed bug #783, which fixes completed and deleted tasks still showing as
active (thanks to Adam Wolk).
# Untracked Bugs, biggest first. # Untracked Bugs, biggest first.
+ Fixed bug that required the '%YAML' prologue in a YAML import. + Fixed bug that required the '%YAML' prologue in a YAML import.

View File

@@ -452,6 +452,7 @@ void Context::clear ()
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Add all the attributes in the task to the filter. All except uuid. // Add all the attributes in the task to the filter. All except uuid.
/*
void Context::autoFilter (Att& a, Filter& f) void Context::autoFilter (Att& a, Filter& f)
{ {
// Words are found in the description using the .has modifier. // Words are found in the description using the .has modifier.
@@ -532,12 +533,13 @@ void Context::autoFilter (Att& a, Filter& f)
a.value ()); a.value ());
} }
} }
*/
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Add all the tags in the task to the filter. // Add all the tags in the task to the filter.
/*
void Context::autoFilter (Filter& f) void Context::autoFilter (Filter& f)
{ {
/*
// This is now a correct implementation of a filter on the presence or absence // This is now a correct implementation of a filter on the presence or absence
// of a tag. The prior code provided the illusion of leftmost partial tag // of a tag. The prior code provided the illusion of leftmost partial tag
// matches, but was really using the 'contains' and 'nocontains' attribute // matches, but was really using the 'contains' and 'nocontains' attribute
@@ -557,8 +559,8 @@ void Context::autoFilter (Filter& f)
f.push_back (Att ("tags", "noword", *tag)); f.push_back (Att ("tags", "noword", *tag));
debug ("auto filter: -" + *tag); debug ("auto filter: -" + *tag);
} }
*/
} }
*/
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// This capability is to answer the question of 'what did I just do to generate // This capability is to answer the question of 'what did I just do to generate

View File

@@ -77,8 +77,8 @@ private:
void determineDataLocation (); void determineDataLocation ();
void createDefaultConfig (); void createDefaultConfig ();
void loadAliases (); void loadAliases ();
void autoFilter (Att&, Filter&); // void autoFilter (Att&, Filter&);
void autoFilter (Filter&); // void autoFilter (Filter&);
void updateXtermTitle (); void updateXtermTitle ();
public: public:
@@ -90,23 +90,9 @@ public:
Directory extension_dir; Directory extension_dir;
Config config; Config config;
/*
Filter filter; // TODO Obsolete
Sequence sequence; // TODO Obsolete
Subst subst; // TODO Obsolete
Task task; // TODO Obsolete
*/
TDB tdb; // TODO Obsolete TDB tdb; // TODO Obsolete
TDB2 tdb2; TDB2 tdb2;
/*
std::string file_override;
std::string var_overrides;
*/
std::map <std::string, std::string> aliases; std::map <std::string, std::string> aliases;
/*
std::vector <std::string> tagAdditions; // TODO Obsolete
std::vector <std::string> tagRemovals; // TODO Obsolete
*/
Hooks hooks; Hooks hooks;
DOM dom; DOM dom;

View File

@@ -63,7 +63,10 @@ void ColumnStart::measure (Task& task, int& minimum, int& maximum)
if (task.has (_attribute)) if (task.has (_attribute))
{ {
if (_style == "active") if (_style == "active")
minimum = maximum = context.config.get ("active.indicator").length (); {
if (! task.has ("end"))
minimum = maximum = context.config.get ("active.indicator").length ();
}
else else
ColumnDate::measure (task, minimum, maximum); ColumnDate::measure (task, minimum, maximum);
} }
@@ -80,10 +83,11 @@ void ColumnStart::render (
{ {
if (_style == "active") if (_style == "active")
{ {
lines.push_back ( if (! task.has ("end"))
color.colorize ( lines.push_back (
rightJustify ( color.colorize (
context.config.get ("active.indicator"), width))); rightJustify (
context.config.get ("active.indicator"), width)));
} }
else else
ColumnDate::render (lines, task, width, color); ColumnDate::render (lines, task, width, color);

View File

@@ -132,12 +132,9 @@ static void colorizePriorityNone (Task& task, const std::string& rule, Color& c)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
static void colorizeActive (Task& task, const std::string& rule, Color& c) static void colorizeActive (Task& task, const std::string& rule, Color& c)
{ {
Task::status status = task.getStatus ();
if (gsColor[rule].nontrivial () && if (gsColor[rule].nontrivial () &&
status != Task::completed && task.has ("start") &&
status != Task::deleted && !task.has ("end"))
task.has ("start"))
c.blend (gsColor[rule]); c.blend (gsColor[rule]);
} }
@@ -157,7 +154,7 @@ static void colorizeProject (Task& task, const std::string& rule, Color& c)
std::string project = task.get ("project"); std::string project = task.get ("project");
std::string rule_trunc = rule.substr (14); std::string rule_trunc = rule.substr (14);
// Match project names leftmost, just like Context::autoFilter. // Match project names leftmost.
if (rule_trunc.length () <= project.length ()) if (rule_trunc.length () <= project.length ())
if (compare (rule_trunc, project.substr (0, rule_trunc.length ()), sensitive)) if (compare (rule_trunc, project.substr (0, rule_trunc.length ()), sensitive))
c.blend (gsColor[rule]); c.blend (gsColor[rule]);