mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
HackStudio: Use is<T> instead of strcmp on a widget class_name() :^)
This commit is contained in:
parent
744322c247
commit
93e82e8459
Notes:
sideshowbarker
2024-07-19 00:14:55 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/93e82e84590
1 changed files with 4 additions and 5 deletions
|
@ -459,13 +459,12 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_remove_current_terminal_acti
|
|||
auto widget = m_action_tab_widget->active_widget();
|
||||
if (!widget)
|
||||
return;
|
||||
if (strcmp(widget->class_name(), "TerminalWrapper") != 0)
|
||||
if (!is<TerminalWrapper>(widget))
|
||||
return;
|
||||
auto terminal = reinterpret_cast<TerminalWrapper*>(widget);
|
||||
if (!terminal->user_spawned())
|
||||
auto& terminal = *static_cast<TerminalWrapper*>(widget);
|
||||
if (!terminal.user_spawned())
|
||||
return;
|
||||
|
||||
m_action_tab_widget->remove_tab(*terminal);
|
||||
m_action_tab_widget->remove_tab(terminal);
|
||||
update_actions();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue