- Converted reports/command to return strings
This commit is contained in:
27
src/TDB.cpp
27
src/TDB.cpp
@@ -206,9 +206,7 @@ bool TDB::deleteT (const T& t)
|
||||
sprintf (endTime, "%u", (unsigned int) time (NULL));
|
||||
it->setAttribute ("end", endTime);
|
||||
|
||||
bool status = overwritePending (all);
|
||||
dbChanged ();
|
||||
return status;
|
||||
return overwritePending (all);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -232,9 +230,7 @@ bool TDB::completeT (const T& t)
|
||||
sprintf (endTime, "%u", (unsigned int) time (NULL));
|
||||
it->setAttribute ("end", endTime);
|
||||
|
||||
bool status = overwritePending (all);
|
||||
dbChanged ();
|
||||
return status;
|
||||
return overwritePending (all);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -261,14 +257,10 @@ bool TDB::addT (const T& t)
|
||||
if (task.getStatus () == T::pending ||
|
||||
task.getStatus () == T::recurring)
|
||||
{
|
||||
bool status = writePending (task);
|
||||
dbChanged ();
|
||||
return status;
|
||||
return writePending (task);
|
||||
}
|
||||
|
||||
bool status = writeCompleted (task);
|
||||
dbChanged ();
|
||||
return status;
|
||||
return writeCompleted (task);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -293,9 +285,7 @@ bool TDB::modifyT (const T& t)
|
||||
pending.push_back (*it);
|
||||
}
|
||||
|
||||
bool status = overwritePending (pending);
|
||||
dbChanged ();
|
||||
return status;
|
||||
return overwritePending (pending);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -378,6 +368,7 @@ bool TDB::overwritePending (std::vector <T>& all)
|
||||
fputs (it->compose ().c_str (), out);
|
||||
|
||||
fclose (out);
|
||||
dbChanged ();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -385,7 +376,7 @@ bool TDB::overwritePending (std::vector <T>& all)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool TDB::writePending (const T& t) const
|
||||
bool TDB::writePending (const T& t)
|
||||
{
|
||||
// Write a single task to the pending file
|
||||
FILE* out;
|
||||
@@ -400,6 +391,7 @@ bool TDB::writePending (const T& t) const
|
||||
fputs (t.compose ().c_str (), out);
|
||||
|
||||
fclose (out);
|
||||
dbChanged ();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -407,7 +399,7 @@ bool TDB::writePending (const T& t) const
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool TDB::writeCompleted (const T& t) const
|
||||
bool TDB::writeCompleted (const T& t)
|
||||
{
|
||||
// Write a single task to the pending file
|
||||
FILE* out;
|
||||
@@ -422,6 +414,7 @@ bool TDB::writeCompleted (const T& t) const
|
||||
fputs (t.compose ().c_str (), out);
|
||||
|
||||
fclose (out);
|
||||
dbChanged ();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user