From 22598feca3a9be76c8391bba09bfde1c852f7225 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Sun, 6 Jan 2019 17:45:22 -0500 Subject: [PATCH] Qt: there is no core info with --disable-menu --- ui/drivers/qt/ui_qt_window.cpp | 47 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/ui/drivers/qt/ui_qt_window.cpp b/ui/drivers/qt/ui_qt_window.cpp index 38505d3f0d..773a081674 100644 --- a/ui/drivers/qt/ui_qt_window.cpp +++ b/ui/drivers/qt/ui_qt_window.cpp @@ -1909,35 +1909,38 @@ void MainWindow::setCoreActions() core_info_get_list(&coreInfoList); - for (j = 0; j < coreInfoList->count; j++) + if (coreInfoList) { - const core_info_t *info = &coreInfoList->list[j]; - - if (core == info->path) + for (j = 0; j < coreInfoList->count; j++) { - if (m_launchWithComboBox->findText(info->core_name) == -1) + const core_info_t *info = &coreInfoList->list[j]; + + if (core == info->path) { - int i = 0; - bool found_existing = false; - - for (i = 0; i < m_launchWithComboBox->count(); i++) + if (m_launchWithComboBox->findText(info->core_name) == -1) { - QVariantMap map = m_launchWithComboBox->itemData(i, Qt::UserRole).toMap(); + int i = 0; + bool found_existing = false; - if (map.value("core_path").toString() == info->path || map.value("core_name").toString() == info->core_name) + for (i = 0; i < m_launchWithComboBox->count(); i++) { - found_existing = true; - break; - } - } + QVariantMap map = m_launchWithComboBox->itemData(i, Qt::UserRole).toMap(); - if (!found_existing) - { - QVariantMap comboBoxMap; - comboBoxMap["core_name"] = info->core_name; - comboBoxMap["core_path"] = info->path; - comboBoxMap["core_selection"] = CORE_SELECTION_PLAYLIST_DEFAULT; - m_launchWithComboBox->addItem(info->core_name, QVariant::fromValue(comboBoxMap)); + if (map.value("core_path").toString() == info->path || map.value("core_name").toString() == info->core_name) + { + found_existing = true; + break; + } + } + + if (!found_existing) + { + QVariantMap comboBoxMap; + comboBoxMap["core_name"] = info->core_name; + comboBoxMap["core_path"] = info->path; + comboBoxMap["core_selection"] = CORE_SELECTION_PLAYLIST_DEFAULT; + m_launchWithComboBox->addItem(info->core_name, QVariant::fromValue(comboBoxMap)); + } } } }