From 3f993e40dfc21e6bb516abf1c0b2977a6204d634 Mon Sep 17 00:00:00 2001 From: John Bradley 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,10 +624,14 @@ OBSScene OBSBasic::GetCurrentScene() return item ? item->data(Qt::UserRole).value() : nullptr; } +OBSSceneItem OBSBasic::GetSceneItem(QListWidgetItem *item) +{ + return item ? item->data(Qt::UserRole).value() : nullptr; +} + OBSSceneItem OBSBasic::GetCurrentSceneItem() { - QListWidgetItem *item = ui->sources->currentItem(); - return item ? item->data(Qt::UserRole).value() : nullptr; + return GetSceneItem(ui->sources->currentItem()); } void OBSBasic::UpdateSources(OBSScene scene) 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);