1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

Ladybird/Qt: Replace the QString-from-AK helpers with a single method

There's no need for 2 overloads for String and DeprecatedString, we can
just use a StringView. This also avoids some cases of needlessly
allocating a DeprecatedString from a StringView when calling this
method.
This commit is contained in:
Timothy Flynn 2023-12-04 09:55:47 -05:00 committed by Andrew Kaster
parent 4d5d282e6a
commit 1aedb0ae5a
8 changed files with 21 additions and 27 deletions

View file

@ -24,7 +24,7 @@ SettingsDialog::SettingsDialog(QMainWindow* window)
m_enable_search->setChecked(Settings::the()->enable_search());
m_search_engine_dropdown = make<QPushButton>(this);
m_search_engine_dropdown->setText(qstring_from_ak_deprecated_string(Settings::the()->search_engine().name));
m_search_engine_dropdown->setText(qstring_from_ak_string(Settings::the()->search_engine().name));
m_search_engine_dropdown->setMaximumWidth(200);
m_enable_autocomplete = make<QCheckBox>(this);
@ -76,7 +76,7 @@ void SettingsDialog::setup_search_engines()
QMenu* search_engine_menu = new QMenu(this);
for (auto const& search_engine : WebView::search_engines()) {
auto search_engine_name = qstring_from_ak_deprecated_string(search_engine.name);
auto search_engine_name = qstring_from_ak_string(search_engine.name);
QAction* action = new QAction(search_engine_name, this);
connect(action, &QAction::triggered, this, [&, search_engine_name = std::move(search_engine_name)]() {