mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +02:00
Task: Converted to use to_string where appropriate
This commit is contained in:
parent
b4035d6ff5
commit
136f849aa8
1 changed files with 3 additions and 8 deletions
11
src/Task.cpp
11
src/Task.cpp
|
@ -219,10 +219,7 @@ const std::string Task::identifier (bool shortened /* = false */) const
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::setAsNow (const std::string& att)
|
||||
{
|
||||
char now[16];
|
||||
sprintf (now, "%u", (unsigned int) time (NULL));
|
||||
set (att, now);
|
||||
|
||||
set (att, std::to_string (time (NULL)));
|
||||
recalc_urgency = true;
|
||||
}
|
||||
|
||||
|
@ -310,15 +307,13 @@ time_t Task::get_date (const std::string& name) const
|
|||
void Task::set (const std::string& name, const std::string& value)
|
||||
{
|
||||
(*this)[name] = json::decode (value);
|
||||
|
||||
recalc_urgency = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::set (const std::string& name, int value)
|
||||
{
|
||||
(*this)[name] = format (value);
|
||||
|
||||
(*this)[name] = std::to_string (value);
|
||||
recalc_urgency = true;
|
||||
}
|
||||
|
||||
|
@ -1018,7 +1013,7 @@ void Task::addAnnotation (const std::string& description)
|
|||
|
||||
do
|
||||
{
|
||||
key = "annotation_" + format ((int) now);
|
||||
key = "annotation_" + std::to_string (now);
|
||||
++now;
|
||||
}
|
||||
while (has (key));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue