summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/Object.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-05 15:46:00 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-05 15:50:22 +0100
commit42f2696355e70de0146c772cc17bf5b238aded4b (patch)
treebb0c9b360ba418bf4034346230565d717903c158 /Libraries/LibCore/Object.cpp
parentca110a6e54c47bd280f27ef092f125fc366a23d9 (diff)
downloadserenity-42f2696355e70de0146c772cc17bf5b238aded4b.zip
LibCore: Add a way to set an individual Core::Object property remotely
Diffstat (limited to 'Libraries/LibCore/Object.cpp')
-rw-r--r--Libraries/LibCore/Object.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Libraries/LibCore/Object.cpp b/Libraries/LibCore/Object.cpp
index ff7e7150ac..c503a23d02 100644
--- a/Libraries/LibCore/Object.cpp
+++ b/Libraries/LibCore/Object.cpp
@@ -173,6 +173,15 @@ void Object::save_to(JsonObject& json)
json.set("parent", (uintptr_t)parent());
}
+bool Object::set_property(const StringView& name, const JsonValue& value)
+{
+ if (name == "name") {
+ set_name(value.to_string());
+ return true;
+ }
+ return false;
+}
+
bool Object::is_ancestor_of(const Object& other) const
{
if (&other == this)