mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
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.
This commit is contained in:
parent
a6f9ad6012
commit
99216b2a87
Notes:
sideshowbarker
2024-07-17 08:25:15 +09:00
Author: https://github.com/trflynn89
Commit: 99216b2a87
Pull-request: https://github.com/SerenityOS/serenity/pull/21711
Issue: https://github.com/SerenityOS/serenity/issues/21710
1 changed files with 1 additions and 3 deletions
|
@ -24,8 +24,6 @@
|
|||
#include <spawn.h>
|
||||
#include <unistd.h>
|
||||
|
||||
using StringViewListModel = GUI::ItemListModel<StringView, ReadonlySpan<StringView>>;
|
||||
|
||||
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<GUI::ComboBox>("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<StringView>::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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue