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