From c497342fd695b980300a80fedec6c4cac155aa87 Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Fri, 23 Apr 2021 04:10:51 -0500 Subject: [PATCH] UI: Cleanup on_scenes_currentItemChanged function Removed unnecessary lines from the function. Also if the source happened to be null, the SetCurrentScene function would be called anyway. Finally, the UpdateContextBar and api lines were removed, as they are also being called with SetCurrentScene. --- UI/window-basic-main.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index f08881d68..5be99f689 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -4694,22 +4694,11 @@ void OBSBasic::AdvAudioPropsDestroyed() void OBSBasic::on_scenes_currentItemChanged(QListWidgetItem *current, QListWidgetItem *prev) { - obs_source_t *source = NULL; - if (current) { - obs_scene_t *scene; - - scene = GetOBSRef(current); - source = obs_scene_get_source(scene); + OBSScene scene = GetOBSRef(current); + SetCurrentScene(scene); } - SetCurrentScene(source); - - if (api) - api->on_event(OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED); - - UpdateContextBar(); - UNUSED_PARAMETER(prev); }