mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
ARWidget: Disable Edit and Remove buttons when no code is selected
Also some minor refactoring of nearby/related code: * Make non-obvious variable types explicit instead of auto. * Throw some consts around. * Use setDisabled(empty) instead of setEnabled(!empty).
This commit is contained in:
@ -166,17 +166,16 @@ void GeckoCodeWidget::ConnectWidgets()
|
||||
|
||||
void GeckoCodeWidget::OnSelectionChanged()
|
||||
{
|
||||
auto items = m_code_list->selectedItems();
|
||||
|
||||
const QList<QListWidgetItem*> items = m_code_list->selectedItems();
|
||||
const bool empty = items.empty();
|
||||
|
||||
m_edit_code->setEnabled(!empty);
|
||||
m_remove_code->setEnabled(!empty);
|
||||
m_edit_code->setDisabled(empty);
|
||||
m_remove_code->setDisabled(empty);
|
||||
|
||||
if (items.empty())
|
||||
if (empty)
|
||||
return;
|
||||
|
||||
auto selected = items[0];
|
||||
const QListWidgetItem* const selected = items[0];
|
||||
|
||||
const int index = selected->data(Qt::UserRole).toInt();
|
||||
|
||||
|
Reference in New Issue
Block a user