mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Recurrence: Converted from sprintf to std::to_string
This commit is contained in:
parent
f339672b89
commit
b4035d6ff5
1 changed files with 3 additions and 10 deletions
|
@ -97,18 +97,14 @@ void handleRecurrence ()
|
|||
rec.set ("uuid", uuid ()); // New UUID.
|
||||
rec.set ("parent", t.get ("uuid")); // Remember mom.
|
||||
rec.setAsNow ("entry"); // New entry date.
|
||||
|
||||
char dueDate[16];
|
||||
sprintf (dueDate, "%u", (unsigned int) d.toEpoch ());
|
||||
rec.set ("due", dueDate); // Store generated due date.
|
||||
rec.set ("due", std::to_string (d.toEpoch ()));
|
||||
|
||||
if (t.has ("wait"))
|
||||
{
|
||||
ISO8601d old_wait (t.get_date ("wait"));
|
||||
ISO8601d old_due (t.get_date ("due"));
|
||||
ISO8601d due (d);
|
||||
sprintf (dueDate, "%u", (unsigned int) (due + (old_wait - old_due)).toEpoch ());
|
||||
rec.set ("wait", dueDate);
|
||||
rec.set ("wait", std::to_string ((due + (old_wait - old_due)).toEpoch ()));
|
||||
rec.setStatus (Task::waiting);
|
||||
mask += 'W';
|
||||
}
|
||||
|
@ -118,10 +114,7 @@ void handleRecurrence ()
|
|||
rec.setStatus (Task::pending);
|
||||
}
|
||||
|
||||
char indexMask[12];
|
||||
sprintf (indexMask, "%u", (unsigned int) i);
|
||||
rec.set ("imask", indexMask); // Store index into mask.
|
||||
|
||||
rec.set ("imask", i);
|
||||
rec.remove ("mask"); // Remove the mask of the parent.
|
||||
|
||||
// Add the new task to the DB.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue