mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 00:57:19 +02:00
Make TDB2.backlog non-public
The stats command gets this information from an API that will also work for TaskChampion. The sync command still accesses the field directly, as the command must be completely rewritten for TaskChampion.
This commit is contained in:
parent
d699ce8cba
commit
c8cfcec48b
6 changed files with 37 additions and 28 deletions
13
src/TDB2.cpp
13
src/TDB2.cpp
|
@ -1259,6 +1259,19 @@ bool TDB2::read_only ()
|
|||
;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int TDB2::num_local_changes ()
|
||||
{
|
||||
std::vector <std::string> lines = backlog.get_lines ();
|
||||
return std::count_if(lines.begin(), lines.end(), [](const auto& line){ return line.front() == '{'; });
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
size_t TDB2::data_size ()
|
||||
{
|
||||
return pending._file.size () + completed._file.size () + undo._file.size () + backlog._file.size ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TDB2::clear ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue