mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 03:35:09 +00:00
HackStudio: Use is<T> instead of strcmp on a widget class_name() :^)
This commit is contained in:
parent
744322c247
commit
93e82e8459
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
Add a link
Reference in a new issue