ソースを参照

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.
Clayton Groeneveld 4 年 前
コミット
c497342fd6
1 ファイル変更2 行追加13 行削除
  1. 2 13
      UI/window-basic-main.cpp

+ 2 - 13
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<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);
 }