From caaec5d97f3c32bc83be8bf036e2d119a0291227 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Tue, 7 Mar 2023 02:07:04 +0100 Subject: [PATCH] requesthandler: Use Frontend API for CreateSceneCollection --- src/requesthandler/RequestHandler_Config.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/requesthandler/RequestHandler_Config.cpp b/src/requesthandler/RequestHandler_Config.cpp index 21530671..b9406d79 100644 --- a/src/requesthandler/RequestHandler_Config.cpp +++ b/src/requesthandler/RequestHandler_Config.cpp @@ -198,10 +198,7 @@ RequestResult RequestHandler::CreateSceneCollection(const Request &request) if (std::find(sceneCollections.begin(), sceneCollections.end(), sceneCollectionName) != sceneCollections.end()) return RequestResult::Error(RequestStatus::ResourceAlreadyExists); - QMainWindow *mainWindow = static_cast(obs_frontend_get_main_window()); - bool success = false; - QMetaObject::invokeMethod(mainWindow, "AddSceneCollection", Qt::BlockingQueuedConnection, Q_RETURN_ARG(bool, success), - Q_ARG(bool, true), Q_ARG(QString, QString::fromStdString(sceneCollectionName))); + bool success = obs_frontend_add_scene_collection(sceneCollectionName.c_str()); if (!success) return RequestResult::Error(RequestStatus::ResourceCreationFailed, "Failed to create the scene collection.");