mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-27 02:42:26 -04:00
frontend: Use OBSBasic::Get() in all places
This reduces duplicated code when getting the OBSBasic context.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
static inline OBSScene GetCurrentScene()
|
||||
{
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
return main->GetCurrentScene();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ SourceTreeItem::SourceTreeItem(SourceTree *tree_, OBSSceneItem sceneitem_) : tre
|
||||
setStyleSheet("background: none");
|
||||
}
|
||||
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
const char *id = obs_source_get_id(source);
|
||||
|
||||
bool sourceVisible = obs_sceneitem_visible(sceneitem);
|
||||
@@ -268,7 +268,7 @@ void SourceTreeItem::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
expand->setChecked(!expand->isChecked());
|
||||
} else {
|
||||
obs_source_t *source = obs_sceneitem_get_source(sceneitem);
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
if (obs_source_configurable(source)) {
|
||||
main->CreatePropertiesWindow(source);
|
||||
}
|
||||
@@ -337,7 +337,7 @@ void SourceTreeItem::ExitEditModeInternal(bool save)
|
||||
return;
|
||||
}
|
||||
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
OBSScene scene = main->GetCurrentScene();
|
||||
|
||||
newName = QT_TO_UTF8(editor->text());
|
||||
|
||||
Reference in New Issue
Block a user