mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
frontend: Use OBSBasic::Get() in all places
This reduces duplicated code when getting the OBSBasic context.
This commit is contained in:
+3
-3
@@ -1216,7 +1216,7 @@ bool OBSApp::notify(QObject *receiver, QEvent *e)
|
||||
|
||||
if (windowType == Qt::WindowType::Dialog || windowType == Qt::WindowType::Window ||
|
||||
windowType == Qt::WindowType::Tool) {
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
if (main)
|
||||
main->SetDisplayAffinity(window);
|
||||
}
|
||||
@@ -1355,7 +1355,7 @@ string GetFormatExt(const char *container)
|
||||
|
||||
string GetOutputFilename(const char *path, const char *container, bool noSpace, bool overwrite, const char *format)
|
||||
{
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
|
||||
os_dir_t *dir = path && path[0] ? os_opendir(path) : nullptr;
|
||||
|
||||
@@ -1558,7 +1558,7 @@ void OBSApp::ProcessSigInt(void)
|
||||
char tmp;
|
||||
recv(sigintFd[1], &tmp, sizeof(tmp), 0);
|
||||
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
if (main)
|
||||
main->close();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user