Android: Disable "Make [NDK] default" button while NDKs list is empty

When pressing the "Make [NDK] Default" button while the list is empty
leads to a crash. The button should actually not be enabled if the list
is empty.

This change disables the button while the NDKs list is empty.

Fixes: QTCREATORBUG-30716
Change-Id: I5f10fd180f62d20210f1b0c0261e4d821d0582dd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Alessandro Portale
2024-04-19 20:45:18 +02:00
parent 2c4b7fa02a
commit 67ab041903

View File

@@ -813,6 +813,7 @@ void AndroidSettingsWidget::updateUI()
}
}
m_makeDefaultNdkButton->setEnabled(m_ndkListWidget->count() > 0);
m_makeDefaultNdkButton->setText(isDefaultNdkSelected() ? Tr::tr("Unset Default")
: Tr::tr("Make Default"));
}