0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

UI: Fix property name bug in frontend API

This commit fixes a bug that would cause the frontend API function
obs_frontend_set_current_scene_collection to never be successful.  Due
to the bug, the following null pointer check would always fail, so the
action would never be triggered.

Modification by Jim: Instead of fixing the typo that caused this to
occur, make it so both scene collection menus and profile menus both use
"file_name" consistently.

Closes jp9000/obs-studio#712
This commit is contained in:
vic 2016-12-01 10:07:39 +08:00 committed by jp9000
parent 3869f6dbc2
commit 7db00a18fa

View File

@ -191,7 +191,7 @@ void OBSBasic::RefreshSceneCollections()
int count = 0;
for (int i = 0; i < menuActions.count(); i++) {
QVariant v = menuActions[i]->property("fileName");
QVariant v = menuActions[i]->property("file_name");
if (v.typeName() != nullptr)
delete menuActions[i];
}
@ -205,7 +205,7 @@ void OBSBasic::RefreshSceneCollections()
file.erase(file.size() - 5, 5);
QAction *action = new QAction(QT_UTF8(name), this);
action->setProperty("fileName", QT_UTF8(path));
action->setProperty("file_name", QT_UTF8(path));
connect(action, &QAction::triggered,
this, &OBSBasic::ChangeSceneCollection);
action->setCheckable(true);
@ -355,7 +355,7 @@ void OBSBasic::ChangeSceneCollection()
if (!action)
return;
fileName = QT_TO_UTF8(action->property("fileName").value<QString>());
fileName = QT_TO_UTF8(action->property("file_name").value<QString>());
if (fileName.empty())
return;