all repos — mgba @ 05cb9d47ab034904c730be225b4d0e476f10f50f

mGBA Game Boy Advance Emulator

Load the right states in the right slots
Jeffrey Pfau jeffrey@endrift.com
Wed, 15 Oct 2014 23:40:52 -0700
commit

05cb9d47ab034904c730be225b4d0e476f10f50f

parent

961121808d23e8286e9ae608ed78d1aef6811274

1 files changed, 6 insertions(+), 6 deletions(-)

jump to
M src/platform/qt/LoadSaveState.cppsrc/platform/qt/LoadSaveState.cpp

@@ -34,9 +34,9 @@ m_slots[8] = m_ui.state9;

int i; for (i = 0; i < NUM_SLOTS; ++i) { - loadState(i); + loadState(i + 1); m_slots[i]->installEventFilter(this); - connect(m_slots[i], &QAbstractButton::clicked, this, [this, i]() { triggerState(i); }); + connect(m_slots[i], &QAbstractButton::clicked, this, [this, i]() { triggerState(i + 1); }); } }

@@ -91,12 +91,12 @@ stateImage.load(&vdev, "PNG");

if (!stateImage.isNull()) { QPixmap statePixmap; statePixmap.convertFromImage(stateImage); - m_slots[slot]->setIcon(statePixmap); - m_slots[slot]->setText(QString()); + m_slots[slot - 1]->setIcon(statePixmap); + m_slots[slot - 1]->setText(QString()); } else { - m_slots[slot]->setText(tr("Slot %1").arg(slot + 1)); + m_slots[slot - 1]->setText(tr("Slot %1").arg(slot)); } - m_slots[slot]->setShortcut(QString::number(slot + 1)); + m_slots[slot - 1]->setShortcut(QString::number(slot)); } void LoadSaveState::triggerState(int slot) {