(Qt) Refactoring the QVariant constructting (#17199)

This commit is contained in:
Viačasłaŭ 2024-11-24 17:17:00 +03:00 committed by GitHub
parent 3e2f0131ae
commit 022288a925
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 13 deletions

View File

@ -1197,12 +1197,7 @@ void CoreOptionsDialog::buildLayout()
}
for (k = 0; k < option->vals->size; k++)
#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0))
combo_box->addItem(option->vals->elems[k].data, QVariant::fromValue(option->key));
#else
combo_box->addItem(option->vals->elems[k].data, option->key);
#endif
combo_box->addItem(option->vals->elems[k].data, QVariant::fromValue(QString(option->key)));
combo_box->setCurrentText(val);
combo_box->setProperty("default_index",

View File

@ -3111,13 +3111,8 @@ void MainWindow::setCoreActions()
if (!found_existing)
{
QVariantMap comboBoxMap;
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
comboBoxMap["core_name"] = QVariant::fromValue(coreInfo->core_name);
comboBoxMap["core_path"] = QVariant::fromValue(coreInfo->path);
#else
comboBoxMap["core_name"] = coreInfo->core_name;
comboBoxMap["core_path"] = coreInfo->path;
#endif
comboBoxMap["core_name"] = QVariant::fromValue(QString(coreInfo->core_name));
comboBoxMap["core_path"] = QVariant::fromValue(QString(coreInfo->path));
comboBoxMap["core_selection"] = CORE_SELECTION_PLAYLIST_DEFAULT;
m_launchWithComboBox->addItem(coreInfo->core_name, QVariant::fromValue(comboBoxMap));
}