Fix sometimes ammo schemes not being saved after changing before an ammo scheme got deleted in session
authorWuzzy <Wuzzy2@mail.ru>
Wed, 25 Oct 2017 23:09:41 +0200
changeset 12763 ad67a3804981
parent 12762 5134c07ce32c
child 12764 272fcd3833d2
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.
QTfrontend/ui/page/pageselectweapon.cpp
QTfrontend/ui/widget/selectWeapon.cpp
QTfrontend/ui/widget/selectWeapon.h
--- 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();