frontend: Use OBSBasic::Get() in all places
This reduces duplicated code when getting the OBSBasic context.
This commit is contained in:
parent
a562b8bf52
commit
4e8b131509
25 changed files with 75 additions and 78 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue