Task Refactoring

- Task is no longer a map of string to Att.  Att is itself a name/
  value pair, so the name was redundant.  Task is now a map of string
  to string.  This brings the obsoletion of Att much closer.
This commit is contained in:
Paul Beckingham
2011-08-07 22:41:25 -04:00
parent 85e77c1958
commit e2a8f85a2f
13 changed files with 120 additions and 128 deletions

View File

@@ -30,7 +30,6 @@
#include <vector>
#include <stdlib.h>
#include <inttypes.h>
#include <Att.h>
#include <Context.h>
#include <main.h>
#include <text.h>
@@ -45,7 +44,7 @@ bool taskDiff (const Task& before, const Task& after)
// Attributes are all there is, so figure the different attribute names
// between before and after.
std::vector <std::string> beforeAtts;
std::map <std::string, Att>::const_iterator att;
Task::const_iterator att;
for (att = before.begin (); att != before.end (); ++att)
beforeAtts.push_back (att->first);
@@ -76,7 +75,7 @@ std::string taskDifferences (const Task& before, const Task& after)
// Attributes are all there is, so figure the different attribute names
// between before and after.
std::vector <std::string> beforeAtts;
std::map <std::string, Att>::const_iterator att;
Task::const_iterator att;
for (att = before.begin (); att != before.end (); ++att)
beforeAtts.push_back (att->first);
@@ -166,7 +165,7 @@ std::string taskInfoDifferences (const Task& before, const Task& after)
// Attributes are all there is, so figure the different attribute names
// between before and after.
std::vector <std::string> beforeAtts;
std::map <std::string, Att>::const_iterator att;
Task::const_iterator att;
for (att = before.begin (); att != before.end (); ++att)
beforeAtts.push_back (att->first);
@@ -283,8 +282,9 @@ std::string taskInfoDifferences (const Task& before, const Task& after)
////////////////////////////////////////////////////////////////////////////////
std::string renderAttribute (const std::string& name, const std::string& value)
{
Att a;
if (a.type (name) == "date" &&
Column* col = context.columns[name];
if (col &&
col->type () == "date" &&
value != "")
{
Date d ((time_t)strtol (value.c_str (), NULL, 10));