Silver Bullet - Complete

- Entry works
- Start works
- End works
This commit is contained in:
Paul Beckingham 2009-05-14 00:46:52 -04:00
parent f97955ded8
commit 612b872ed4

View file

@ -238,13 +238,12 @@ static void parseTask (Config& conf, T& task, const std::string& after)
}
// entry
/*
value = findDate (conf, after, "Created:");
if (value != "")
{
Date original (::atoi (task.getAttribute ("entry").c_str ()));
Date edited (::atoi (value.c_str ()));
Date original (::atoi (task.getAttribute ("entry").c_str ()));
if (!original.sameDay (edited))
{
std::cout << "Creation date modified." << std::endl;
@ -252,17 +251,17 @@ static void parseTask (Config& conf, T& task, const std::string& after)
}
}
else
std::cout << "Cannot remove creation date." << std::endl;
*/
throw std::string ("Cannot remove creation date");
// start
/*
value = findDate (conf, after, "Start:");
value = findDate (conf, after, "Started:");
if (value != "")
{
Date original (::atoi (task.getAttribute ("start").c_str ()));
Date edited (::atoi (value.c_str ()));
if (task.getAttribute ("start") != "")
{
Date original (::atoi (task.getAttribute ("start").c_str ()));
if (!original.sameDay (edited))
{
std::cout << "Start date modified." << std::endl;
@ -271,36 +270,46 @@ static void parseTask (Config& conf, T& task, const std::string& after)
}
else
{
Date original (::atoi (task.getAttribute ("start").c_str ()));
Date edited (::atoi (value.c_str ()));
if (!original.sameDay (edited))
std::cout << "Start date modified." << std::endl;
task.setAttribute ("start", value);
}
}
else
{
if (task.getAttribute ("start") != "")
{
std::cout << "Start date removed." << std::endl;
task.removeAttribute ("start");
}
}
std::cout << "Cannot remove start date." << std::endl;
}
*/
// end
/*
value = findDate (conf, after, "Ended:");
if (value != "")
{
Date original (::atoi (task.getAttribute ("end").c_str ()));
Date edited (::atoi (value.c_str ()));
if (task.getAttribute ("end") != "")
{
Date original (::atoi (task.getAttribute ("end").c_str ()));
if (!original.sameDay (edited))
{
std::cout << "Done date modified." << std::endl;
task.setAttribute ("end", value);
}
}
else if (task.getStatus () != T::deleted)
throw std::string ("Cannot set a done date on a pending task.");
}
else
{
if (task.getAttribute ("end") != "")
{
std::cout << "Done date removed." << std::endl;
task.setStatus (T::pending);
task.removeAttribute ("end");
}
*/
}
// due
value = findDate (conf, after, "Due:");
@ -393,7 +402,11 @@ static void parseTask (Config& conf, T& task, const std::string& after)
else
{
std::cout << "Recurrence removed." << std::endl;
task.setStatus (T::pending);
task.removeAttribute ("recur");
task.removeAttribute ("until");
task.removeAttribute ("mask");
task.removeAttribute ("imask");
}
}