diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-10 12:53:32 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-10 13:45:49 +0200 |
commit | 563d3bdcc9e474c6418a615d07f4891abe9138d2 (patch) | |
tree | 77219b2c9fc36489943a9cf0ab6b5adbae805f42 | |
parent | 60064e204984db4df2bca866b42a8bc18d8d70ae (diff) | |
download | serenity-563d3bdcc9e474c6418a615d07f4891abe9138d2.zip |
HackStudio: Use is<GitWidget>() instead of comparing class_name()
-rw-r--r-- | Userland/DevTools/HackStudio/HackStudioWidget.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 2803fe417f..472f320d49 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -153,11 +153,10 @@ void HackStudioWidget::update_actions() void HackStudioWidget::on_action_tab_change() { update_actions(); - auto active_widget = m_action_tab_widget->active_widget(); - if (!active_widget) - return; - if (StringView { "GitWidget" } == active_widget->class_name()) - reinterpret_cast<GitWidget*>(active_widget)->refresh(); + if (auto* active_widget = m_action_tab_widget->active_widget()) { + if (is<GitWidget>(*active_widget)) + static_cast<GitWidget&>(*active_widget).refresh(); + } } void HackStudioWidget::open_project(const String& root_path) |