Task
- Added 'modified' attribute in ::validate, if not already present. This is not strictly necessary, but it is good to be explicit.
This commit is contained in:
22
src/Task.cpp
22
src/Task.cpp
@@ -184,9 +184,9 @@ std::string Task::statusToText (Task::status s)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::setEntry ()
|
||||
{
|
||||
char entryTime[16];
|
||||
sprintf (entryTime, "%u", (unsigned int) time (NULL));
|
||||
set ("entry", entryTime);
|
||||
char now[16];
|
||||
sprintf (now, "%u", (unsigned int) time (NULL));
|
||||
set ("entry", now);
|
||||
|
||||
recalc_urgency = true;
|
||||
}
|
||||
@@ -194,9 +194,9 @@ void Task::setEntry ()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::setEnd ()
|
||||
{
|
||||
char endTime[16];
|
||||
sprintf (endTime, "%u", (unsigned int) time (NULL));
|
||||
set ("end", endTime);
|
||||
char now[16];
|
||||
sprintf (now, "%u", (unsigned int) time (NULL));
|
||||
set ("end", now);
|
||||
|
||||
recalc_urgency = true;
|
||||
}
|
||||
@@ -204,9 +204,9 @@ void Task::setEnd ()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::setStart ()
|
||||
{
|
||||
char startTime[16];
|
||||
sprintf (startTime, "%u", (unsigned int) time (NULL));
|
||||
set ("start", startTime);
|
||||
char now[16];
|
||||
sprintf (now, "%u", (unsigned int) time (NULL));
|
||||
set ("start", now);
|
||||
|
||||
recalc_urgency = true;
|
||||
}
|
||||
@@ -1492,6 +1492,10 @@ void Task::validate (bool applyDefault /* = true */)
|
||||
(! has ("end") || get ("end") == ""))
|
||||
setEnd ();
|
||||
|
||||
// Provide an entry date unless user already specified one.
|
||||
if (!has ("modified") || get ("modified") == "")
|
||||
setModified ();
|
||||
|
||||
if (applyDefault)
|
||||
{
|
||||
// Override with default.project, if not specified.
|
||||
|
||||
Reference in New Issue
Block a user