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:
committed by
Tomas Babej
parent
d699ce8cba
commit
c8cfcec48b
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 ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user