From 3f993e40dfc21e6bb516abf1c0b2977a6204d634 Mon Sep 17 00:00:00 2001
From: John Bradley <jrb@turrettech.com>
Date: Mon, 15 Sep 2014 18:04:22 -0500
Subject: [PATCH] Add helper function to get specific scene item

---
 obs/window-basic-main.cpp | 8 ++++++--
 obs/window-basic-main.hpp | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp
index bf516015b..6def5ffb4 100644
--- a/obs/window-basic-main.cpp
+++ b/obs/window-basic-main.cpp
@@ -624,12 +624,16 @@ OBSScene OBSBasic::GetCurrentScene()
 	return item ? item->data(Qt::UserRole).value<OBSScene>() : nullptr;
 }
 
-OBSSceneItem OBSBasic::GetCurrentSceneItem()
+OBSSceneItem OBSBasic::GetSceneItem(QListWidgetItem *item)
 {
-	QListWidgetItem *item = ui->sources->currentItem();
 	return item ? item->data(Qt::UserRole).value<OBSSceneItem>() : nullptr;
 }
 
+OBSSceneItem OBSBasic::GetCurrentSceneItem()
+{
+	return GetSceneItem(ui->sources->currentItem());
+}
+
 void OBSBasic::UpdateSources(OBSScene scene)
 {
 	ui->sources->clear();
diff --git a/obs/window-basic-main.hpp b/obs/window-basic-main.hpp
index 516c179d3..c46258c5a 100644
--- a/obs/window-basic-main.hpp
+++ b/obs/window-basic-main.hpp
@@ -120,6 +120,7 @@ private:
 
 	void          InitPrimitives();
 
+	OBSSceneItem  GetSceneItem(QListWidgetItem *item);
 	OBSSceneItem  GetCurrentSceneItem();
 
 	bool          QueryRemoveSource(obs_source_t source);
-- 
GitLab