Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix profile functions that direct call a method instead of the API #1265

Merged
merged 4 commits into from
Oct 29, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/requesthandler/RequestHandler_Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,7 @@ RequestResult RequestHandler::CreateProfile(const Request &request)
if (std::find(profiles.begin(), profiles.end(), profileName) != profiles.end())
return RequestResult::Error(RequestStatus::ResourceAlreadyExists);

QMainWindow *mainWindow = static_cast<QMainWindow *>(obs_frontend_get_main_window());
QMetaObject::invokeMethod(mainWindow, "NewProfile", Qt::BlockingQueuedConnection,
Q_ARG(QString, QString::fromStdString(profileName)));
obs_frontend_create_profile(QString::fromStdString(profileName));
BarryCarlyon marked this conversation as resolved.
Show resolved Hide resolved

return RequestResult::Success();
}
Expand Down Expand Up @@ -324,9 +322,7 @@ RequestResult RequestHandler::RemoveProfile(const Request &request)
if (profiles.size() < 2)
return RequestResult::Error(RequestStatus::NotEnoughResources);

QMainWindow *mainWindow = static_cast<QMainWindow *>(obs_frontend_get_main_window());
QMetaObject::invokeMethod(mainWindow, "DeleteProfile", Qt::BlockingQueuedConnection,
Q_ARG(QString, QString::fromStdString(profileName)));
obs_frontend_delete_profile(QString::fromStdString(profileName));

return RequestResult::Success();
}
Expand Down