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.
--- 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;
--- 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;
+}
--- 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();