1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:15:06 +00:00

Userland: Remove serialize-to-JSON functions only used for Inspector

This commit is contained in:
Andreas Kling 2023-04-24 10:36:53 +02:00
parent c756e021a7
commit 3de8dd921e
8 changed files with 0 additions and 112 deletions

View file

@ -2348,32 +2348,6 @@ void Shell::kill_job(Job const* job, int sig)
}
}
ErrorOr<void> Shell::save_to(JsonObject& object)
{
Core::Object::save_to(object);
object.set("working_directory", cwd);
object.set("username", username);
object.set("user_home_path", home);
object.set("user_id", uid);
object.set("directory_stack_size", directory_stack.size());
object.set("cd_history_size", cd_history.size());
// Jobs.
JsonArray job_objects;
for (auto& job_entry : jobs) {
JsonObject job_object;
job_object.set("pid", job_entry.value->pid());
job_object.set("pgid", job_entry.value->pgid());
job_object.set("running_time", job_entry.value->timer().elapsed());
job_object.set("command", job_entry.value->cmd());
job_object.set("is_running_in_background", job_entry.value->is_running_in_background());
TRY(job_objects.append(move(job_object)));
}
object.set("jobs", move(job_objects));
return {};
}
void Shell::possibly_print_error() const
{
switch (m_error) {