From 7db00a18fab8a29f9a7996826756794598a48acf Mon Sep 17 00:00:00 2001 From: vic Date: Thu, 1 Dec 2016 10:07:39 +0800 Subject: [PATCH] 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 --- UI/window-basic-main-scene-collections.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UI/window-basic-main-scene-collections.cpp b/UI/window-basic-main-scene-collections.cpp index c35b0b101..909ad2215 100644 --- a/UI/window-basic-main-scene-collections.cpp +++ b/UI/window-basic-main-scene-collections.cpp @@ -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()); + fileName = QT_TO_UTF8(action->property("file_name").value()); if (fileName.empty()) return;