summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2023-05-14 19:38:08 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-15 06:42:10 +0200
commitb7558a5ce43c62efb357863f709d942daf9aa218 (patch)
tree6ee78cf24bf91569189b3383814dd99a454ece95 /Userland/Libraries
parent945f05ed76b23e8b201ce0a758d5318723440d36 (diff)
downloadserenity-b7558a5ce43c62efb357863f709d942daf9aa218.zip
LibGUI+Userland: Store column names in JsonArrayModel as String
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/JsonArrayModel.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGUI/JsonArrayModel.h b/Userland/Libraries/LibGUI/JsonArrayModel.h
index c34a802c00..1913da23b1 100644
--- a/Userland/Libraries/LibGUI/JsonArrayModel.h
+++ b/Userland/Libraries/LibGUI/JsonArrayModel.h
@@ -16,7 +16,7 @@ namespace GUI {
class JsonArrayModel final : public Model {
public:
struct FieldSpec {
- FieldSpec(DeprecatedString const& a_column_name, Gfx::TextAlignment a_text_alignment, Function<Variant(JsonObject const&)>&& a_massage_for_display, Function<Variant(JsonObject const&)>&& a_massage_for_sort = {}, Function<Variant(JsonObject const&)>&& a_massage_for_custom = {})
+ FieldSpec(String const& a_column_name, Gfx::TextAlignment a_text_alignment, Function<Variant(JsonObject const&)>&& a_massage_for_display, Function<Variant(JsonObject const&)>&& a_massage_for_sort = {}, Function<Variant(JsonObject const&)>&& a_massage_for_custom = {})
: column_name(a_column_name)
, text_alignment(a_text_alignment)
, massage_for_display(move(a_massage_for_display))
@@ -25,7 +25,7 @@ public:
{
}
- FieldSpec(DeprecatedString const& a_json_field_name, DeprecatedString const& a_column_name, Gfx::TextAlignment a_text_alignment)
+ FieldSpec(DeprecatedString const& a_json_field_name, String const& a_column_name, Gfx::TextAlignment a_text_alignment)
: json_field_name(a_json_field_name)
, column_name(a_column_name)
, text_alignment(a_text_alignment)
@@ -33,7 +33,7 @@ public:
}
DeprecatedString json_field_name;
- DeprecatedString column_name;
+ String column_name;
Gfx::TextAlignment text_alignment;
Function<Variant(JsonObject const&)> massage_for_display;
Function<Variant(JsonObject const&)> massage_for_sort;
@@ -49,7 +49,7 @@ public:
virtual int row_count(ModelIndex const& = ModelIndex()) const override { return m_array.size(); }
virtual int column_count(ModelIndex const& = ModelIndex()) const override { return m_fields.size(); }
- virtual String column_name(int column) const override { return String::from_deprecated_string(m_fields[column].column_name).release_value_but_fixme_should_propagate_errors(); }
+ virtual String column_name(int column) const override { return m_fields[column].column_name; }
virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const override;
virtual void invalidate() override;
virtual void update();