diff options
author | asynts <asynts@gmail.com> | 2020-09-20 21:01:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-20 21:10:46 +0200 |
commit | 03a27bc69348c90a39fccf05702aa36870204684 (patch) | |
tree | fffec5cfcfa5dc90b0839b73d257d2852565e2c3 /Libraries | |
parent | 3ce97b9c0ede6b656fec136a66d7fa8527eaf3ed (diff) | |
download | serenity-03a27bc69348c90a39fccf05702aa36870204684.zip |
LibGUI: Remove unnecessary type cast in JsonArrayModel.
Since TCP sequence numbers are randomly choosen 32-bit numbers, it often
happend that the most significant bit was set. The cast to a 32-bit
signed integer then made the number negative.
Thus TCP sequence were shown negative in the SystemMonitor every so
often.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/JsonArrayModel.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/JsonArrayModel.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibGUI/JsonArrayModel.cpp b/Libraries/LibGUI/JsonArrayModel.cpp index 0837dbcb55..31e6430200 100644 --- a/Libraries/LibGUI/JsonArrayModel.cpp +++ b/Libraries/LibGUI/JsonArrayModel.cpp @@ -107,7 +107,7 @@ Variant JsonArrayModel::data(const ModelIndex& index, ModelRole role) const if (field_spec.massage_for_display) return field_spec.massage_for_display(object); if (data.is_number()) - return data.to_i32(); + return data; return object.get(json_field_name).to_string(); } diff --git a/Libraries/LibGUI/JsonArrayModel.h b/Libraries/LibGUI/JsonArrayModel.h index 9b19fb81e0..1c44917dcf 100644 --- a/Libraries/LibGUI/JsonArrayModel.h +++ b/Libraries/LibGUI/JsonArrayModel.h @@ -64,7 +64,7 @@ public: return adopt(*new JsonArrayModel(json_path, move(fields))); } - virtual ~JsonArrayModel() override {} + virtual ~JsonArrayModel() override { } virtual int row_count(const ModelIndex& = ModelIndex()) const override { return m_array.size(); } virtual int column_count(const ModelIndex& = ModelIndex()) const override { return m_fields.size(); } |