Merge pull request #16175 from MiladNazeri/dev-551/hide-crash-menu-behind-enviornment-variables

DEV-551/hide-crash-menu-behind-environment-variable
This commit is contained in:
MiladNazeri 2019-09-11 15:47:40 -07:00 committed by GitHub
commit fb9a6a3c78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -725,6 +725,10 @@ Menu::Menu() {
DependencyManager::get<PickManager>().data(), SLOT(setForceCoarsePicking(bool)));
// Developer > Crash >>>
bool result = false;
const QString HIFI_SHOW_DEVELOPER_CRASH_MENU("HIFI_SHOW_DEVELOPER_CRASH_MENU");
result = QProcessEnvironment::systemEnvironment().contains(HIFI_SHOW_DEVELOPER_CRASH_MENU);
if (result) {
MenuWrapper* crashMenu = developerMenu->addMenu("Crash");
// Developer > Crash > Display Crash Options
@ -764,6 +768,8 @@ Menu::Menu() {
connect(action, &QAction::triggered, qApp, []() { std::thread(crash::newFault).join(); });
addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashOnShutdown, 0, qApp, SLOT(crashOnShutdown()));
}
// Developer > Show Statistics
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Stats, 0, true);