Browser: Pass Tab::on_title_change title argument as const reference

This commit is contained in:
Linus Groh 2021-05-29 01:14:04 +01:00
parent 507c5b6248
commit 94a56c3aee
Notes: sideshowbarker 2024-07-18 17:15:41 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -477,7 +477,7 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
VERIFY(default_favicon);
m_tab_widget->set_tab_icon(new_tab, default_favicon);
new_tab.on_title_change = [this, &new_tab](auto title) {
new_tab.on_title_change = [this, &new_tab](auto& title) {
m_tab_widget->set_tab_title(new_tab, title);
if (m_tab_widget->active_widget() == &new_tab)
set_window_title_for_tab(new_tab);

View file

@ -55,7 +55,7 @@ public:
void action_entered(GUI::Action&);
void action_left(GUI::Action&);
Function<void(String)> on_title_change;
Function<void(const String&)> on_title_change;
Function<void(const URL&)> on_tab_open_request;
Function<void(Tab&)> on_tab_close_request;
Function<void(const Gfx::Bitmap&)> on_favicon_change;