remove constness from composeJSON so it can use caches

This commit is contained in:
Dustin J. Mitchell 2025-05-05 08:51:24 -04:00
parent c60f1d6de0
commit b442935ee2
No known key found for this signature in database
4 changed files with 4 additions and 4 deletions

View file

@ -275,7 +275,7 @@ void Hooks::onAdd(Task& task) const {
// - all emitted non-JSON lines are considered feedback or error messages
// depending on the status code.
//
void Hooks::onModify(const Task& before, Task& after) const {
void Hooks::onModify(Task& before, Task& after) const {
if (!_enabled) return;
Timer timer;

View file

@ -40,7 +40,7 @@ class Hooks {
void onLaunch() const;
void onExit() const;
void onAdd(Task&) const;
void onModify(const Task&, Task&) const;
void onModify(Task&, Task&) const;
std::vector<std::string> list() const;
private:

View file

@ -777,7 +777,7 @@ void Task::parseLegacy(const std::string& line) {
}
////////////////////////////////////////////////////////////////////////////////
std::string Task::composeJSON(bool decorate /*= false*/) const {
std::string Task::composeJSON(bool decorate /*= false*/) {
std::stringstream out;
out << '{';

View file

@ -68,7 +68,7 @@ class Task {
Task(rust::Box<tc::TaskData>);
void parse(const std::string&);
std::string composeJSON(bool decorate = false) const;
std::string composeJSON(bool decorate = false);
// Status values.
enum status { pending, completed, deleted, recurring, waiting };