From 99216b2a870a401e186d51de6f0d7cc5bf4a49a7 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 31 Oct 2023 10:02:41 -0400 Subject: [PATCH] ClockSettings: Use a Vector as the time zone model's container type The time zones were stored as a static Span until commit 0bc401a1d6, and are now stored in a Vector. By continuing to tell the ItemListModel that the container is a Span, we create a temporary Span in its constructor, which the model tries to hold a constant reference to. Use the default Vector container type now instead to prevent creating such temporaries. --- .../Applications/ClockSettings/TimeZoneSettingsWidget.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Userland/Applications/ClockSettings/TimeZoneSettingsWidget.cpp b/Userland/Applications/ClockSettings/TimeZoneSettingsWidget.cpp index 06a5ebad55..521145ae94 100644 --- a/Userland/Applications/ClockSettings/TimeZoneSettingsWidget.cpp +++ b/Userland/Applications/ClockSettings/TimeZoneSettingsWidget.cpp @@ -24,8 +24,6 @@ #include #include -using StringViewListModel = GUI::ItemListModel>; - static constexpr auto PI_OVER_180 = M_PIf32 / 180.0f; static constexpr auto PI_OVER_4 = M_PIf32 / 4.0f; static constexpr auto TAU = M_PIf32 * 2.0f; @@ -78,7 +76,7 @@ TimeZoneSettingsWidget::TimeZoneSettingsWidget() m_time_zone_combo_box = *find_descendant_of_type_named("time_zone_input"); m_time_zone_combo_box->set_only_allow_values_from_model(true); - m_time_zone_combo_box->set_model(*StringViewListModel::create(time_zones)); + m_time_zone_combo_box->set_model(*GUI::ItemListModel::create(time_zones)); m_time_zone_combo_box->set_text(m_time_zone); m_time_zone_combo_box->on_change = [&](auto, auto) { set_modified(true);