Skip to content

Commit

Permalink
Switch to obs_frontend_create_profile // obs_frontend_delete_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
BarryCarlyon committed Oct 24, 2024
1 parent a4cff11 commit f0eadf8
Showing 1 changed file with 2 additions and 6 deletions.
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, "CreateNewProfile", Qt::BlockingQueuedConnection,
Q_ARG(QString, QString::fromStdString(profileName)));
obs_frontend_create_profile(QString::fromStdString(profileName));

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

0 comments on commit f0eadf8

Please sign in to comment.