# HG changeset patch # User Wuzzy # Date 1508965781 -7200 # Node ID ad67a38049811f06fbbc3cd30a595ff574d217d0 # Parent 5134c07ce32cee05a4a1f7622ac8054fd891a9e8 Fix sometimes ammo schemes not being saved after changing before an ammo scheme got deleted in session This was because the bool isDeleting is not initialized, so its initial value is unpredictable. Which means there's chance it starts with true, confusing the frontend. diff -r 5134c07ce32c -r ad67a3804981 QTfrontend/ui/page/pageselectweapon.cpp --- a/QTfrontend/ui/page/pageselectweapon.cpp Wed Oct 25 15:37:16 2017 -0400 +++ b/QTfrontend/ui/page/pageselectweapon.cpp Wed Oct 25 23:09:41 2017 +0200 @@ -30,6 +30,7 @@ QGridLayout * pageLayout = new QGridLayout(); pWeapons = new SelWeaponWidget(cAmmoNumber, this); + pWeapons->init(); pageLayout->addWidget(pWeapons); return pageLayout; diff -r 5134c07ce32c -r ad67a3804981 QTfrontend/ui/widget/selectWeapon.cpp --- a/QTfrontend/ui/widget/selectWeapon.cpp Wed Oct 25 15:37:16 2017 -0400 +++ b/QTfrontend/ui/widget/selectWeapon.cpp Wed Oct 25 23:09:41 2017 +0200 @@ -383,3 +383,8 @@ { isDeleting = false; } + +void SelWeaponWidget::init() +{ + isDeleting = false; +} diff -r 5134c07ce32c -r ad67a3804981 QTfrontend/ui/widget/selectWeapon.h --- a/QTfrontend/ui/widget/selectWeapon.h Wed Oct 25 15:37:16 2017 -0400 +++ b/QTfrontend/ui/widget/selectWeapon.h Wed Oct 25 23:09:41 2017 +0200 @@ -53,6 +53,7 @@ QString getWeaponsString(const QString& name) const; QStringList getWeaponNames() const; void deletionDone(); + void init(); public slots: void setDefault();