mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 17:17:42 +00:00
Shell: Use JsonArray::append
in save_to
We can convert it into a failable function here easily
This commit is contained in:
parent
ba38984a60
commit
da305017de
2 changed files with 5 additions and 3 deletions
|
@ -2348,7 +2348,7 @@ void Shell::kill_job(Job const* job, int sig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shell::save_to(JsonObject& object)
|
ErrorOr<void> Shell::save_to(JsonObject& object)
|
||||||
{
|
{
|
||||||
Core::Object::save_to(object);
|
Core::Object::save_to(object);
|
||||||
object.set("working_directory", cwd);
|
object.set("working_directory", cwd);
|
||||||
|
@ -2367,9 +2367,11 @@ void Shell::save_to(JsonObject& object)
|
||||||
job_object.set("running_time", job_entry.value->timer().elapsed());
|
job_object.set("running_time", job_entry.value->timer().elapsed());
|
||||||
job_object.set("command", job_entry.value->cmd());
|
job_object.set("command", job_entry.value->cmd());
|
||||||
job_object.set("is_running_in_background", job_entry.value->is_running_in_background());
|
job_object.set("is_running_in_background", job_entry.value->is_running_in_background());
|
||||||
job_objects.must_append(move(job_object));
|
TRY(job_objects.append(move(job_object)));
|
||||||
}
|
}
|
||||||
object.set("jobs", move(job_objects));
|
object.set("jobs", move(job_objects));
|
||||||
|
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shell::possibly_print_error() const
|
void Shell::possibly_print_error() const
|
||||||
|
|
|
@ -402,7 +402,7 @@ private:
|
||||||
bool is_allowed_to_modify_termios(const AST::Command&) const;
|
bool is_allowed_to_modify_termios(const AST::Command&) const;
|
||||||
|
|
||||||
// FIXME: Port to Core::Property
|
// FIXME: Port to Core::Property
|
||||||
void save_to(JsonObject&);
|
ErrorOr<void> save_to(JsonObject&);
|
||||||
void bring_cursor_to_beginning_of_a_line() const;
|
void bring_cursor_to_beginning_of_a_line() const;
|
||||||
|
|
||||||
Optional<int> resolve_job_spec(StringView);
|
Optional<int> resolve_job_spec(StringView);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue