mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-02 23:54:34 +02:00
replace currentData with itemData on QComboBox::currentIndexChanged slots
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com> (cherry picked from commit 0cafac84ac6328fefb8992de2c6a2385b1c0053c)
This commit is contained in:
parent
1e696328bb
commit
c3cf5d31da
@ -325,9 +325,9 @@ void ResourcePage::onSelectionChanged(QModelIndex curr, [[maybe_unused]] QModelI
|
||||
updateUi();
|
||||
}
|
||||
|
||||
void ResourcePage::onVersionSelectionChanged(int)
|
||||
void ResourcePage::onVersionSelectionChanged(int index)
|
||||
{
|
||||
m_selectedVersionIndex = m_ui->versionSelectionBox->currentData().toInt();
|
||||
m_selectedVersionIndex = m_ui->versionSelectionBox->itemData(index).toInt();
|
||||
updateSelectionButton();
|
||||
}
|
||||
|
||||
@ -364,10 +364,10 @@ void ResourcePage::onResourceSelected()
|
||||
|
||||
auto& version = current_pack->versions[m_selectedVersionIndex];
|
||||
if (version.downloadUrl.isNull()) {
|
||||
CustomMessageBox::selectable(this, tr("How?"),
|
||||
"You managed to select a resource that doesn't have a download link. Because of this missing "
|
||||
"information prism will not try to download it.",
|
||||
QMessageBox::Warning)
|
||||
CustomMessageBox::selectable(
|
||||
this, tr("Download Link Missing"),
|
||||
tr("It looks like the resource you selected doesn't have a download link, so Prism won't attempt to download it."),
|
||||
QMessageBox::Warning)
|
||||
->show();
|
||||
return;
|
||||
}
|
||||
@ -485,7 +485,7 @@ void ResourcePage::openProject(QVariant projectID)
|
||||
m_ui->gridLayout_4->addWidget(buttonBox, 1, 2);
|
||||
|
||||
connect(m_ui->versionSelectionBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
[this, okBtn] { okBtn->setEnabled(m_ui->versionSelectionBox->currentData().toInt() >= 0); });
|
||||
[this, okBtn](int index) { okBtn->setEnabled(m_ui->versionSelectionBox->itemData(index).toInt() >= 0); });
|
||||
|
||||
auto jump = [this] {
|
||||
for (int row = 0; row < m_model->rowCount({}); row++) {
|
||||
|
@ -273,7 +273,7 @@ void FlamePage::suggestCurrent()
|
||||
void FlamePage::onVersionSelectionChanged(int index)
|
||||
{
|
||||
bool is_blocked = false;
|
||||
ui->versionSelectionBox->currentData().toInt(&is_blocked);
|
||||
ui->versionSelectionBox->itemData(index).toInt(&is_blocked);
|
||||
|
||||
if (index == -1 || is_blocked) {
|
||||
m_selected_version_index = -1;
|
||||
|
@ -375,7 +375,7 @@ void ModrinthPage::onVersionSelectionChanged(int index)
|
||||
selectedVersion = "";
|
||||
return;
|
||||
}
|
||||
selectedVersion = ui->versionSelectionBox->currentData().toString();
|
||||
selectedVersion = ui->versionSelectionBox->itemData(index).toString();
|
||||
suggestCurrent();
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ void ThemeCustomizationWidget::applyIconTheme(int index)
|
||||
{
|
||||
auto settings = APPLICATION->settings();
|
||||
auto originalIconTheme = settings->get("IconTheme").toString();
|
||||
auto newIconTheme = ui->iconsComboBox->currentData().toString();
|
||||
auto newIconTheme = ui->iconsComboBox->itemData(index).toString();
|
||||
if (originalIconTheme != newIconTheme) {
|
||||
settings->set("IconTheme", newIconTheme);
|
||||
APPLICATION->themeManager()->applyCurrentlySelectedTheme();
|
||||
@ -100,7 +100,7 @@ void ThemeCustomizationWidget::applyWidgetTheme(int index)
|
||||
{
|
||||
auto settings = APPLICATION->settings();
|
||||
auto originalAppTheme = settings->get("ApplicationTheme").toString();
|
||||
auto newAppTheme = ui->widgetStyleComboBox->currentData().toString();
|
||||
auto newAppTheme = ui->widgetStyleComboBox->itemData(index).toString();
|
||||
if (originalAppTheme != newAppTheme) {
|
||||
settings->set("ApplicationTheme", newAppTheme);
|
||||
APPLICATION->themeManager()->applyCurrentlySelectedTheme();
|
||||
@ -113,7 +113,7 @@ void ThemeCustomizationWidget::applyCatTheme(int index)
|
||||
{
|
||||
auto settings = APPLICATION->settings();
|
||||
auto originalCat = settings->get("BackgroundCat").toString();
|
||||
auto newCat = ui->backgroundCatComboBox->currentData().toString();
|
||||
auto newCat = ui->backgroundCatComboBox->itemData(index).toString();
|
||||
if (originalCat != newCat) {
|
||||
settings->set("BackgroundCat", newCat);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user