Преглед изворни кода

LibCore: Make Core::Object::property() const

Andreas Kling пре 4 година
родитељ
комит
6041e48eaa
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      Libraries/LibCore/Object.cpp
  2. 1 1
      Libraries/LibCore/Object.h

+ 1 - 1
Libraries/LibCore/Object.cpp

@@ -195,7 +195,7 @@ void Object::save_to(JsonObject& json)
     }
 }
 
-JsonValue Object::property(const StringView& name)
+JsonValue Object::property(const StringView& name) const
 {
     auto it = m_properties.find(name);
     if (it == m_properties.end())

+ 1 - 1
Libraries/LibCore/Object.h

@@ -120,7 +120,7 @@ public:
     void save_to(AK::JsonObject&);
 
     bool set_property(const StringView& name, const JsonValue& value);
-    JsonValue property(const StringView& name);
+    JsonValue property(const StringView& name) const;
     const HashMap<String, NonnullOwnPtr<Property>>& properties() const { return m_properties; }
 
     static IntrusiveList<Object, &Object::m_all_objects_list_node>& all_objects();