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.
This commit is contained in:
Clayton Groeneveld
2021-04-23 04:10:51 -05:00
committed by Jim
parent 387a2c5f3e
commit c497342fd6

View File

@@ -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<OBSScene>(current);
source = obs_scene_get_source(scene);
OBSScene scene = GetOBSRef<OBSScene>(current);
SetCurrentScene(scene);
}
SetCurrentScene(source);
if (api)
api->on_event(OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED);
UpdateContextBar();
UNUSED_PARAMETER(prev);
}