Workaround bug (each time losing room master status, even when joining mutliple rooms, new instance of NetAmmoSchemeModel created, receiving schemeConfig and modifying its 43rd member, thus the last model which accepts this signal has the string cut down several times, workaround creates copy of qstringlist to avoid modifying shared message instance. Proper fix would delete unneeded instances of NetAmmoSchemeModel, but who cares) 0.9.21
authorunc0rr
Sat, 27 Dec 2014 22:09:31 +0300
branch0.9.21
changeset 10721 9b789de8e5df
parent 10719 dd5e2427b3b2
child 10723 2cfa65083621
Workaround bug (each time losing room master status, even when joining mutliple rooms, new instance of NetAmmoSchemeModel created, receiving schemeConfig and modifying its 43rd member, thus the last model which accepts this signal has the string cut down several times, workaround creates copy of qstringlist to avoid modifying shared message instance. Proper fix would delete unneeded instances of NetAmmoSchemeModel, but who cares)
QTfrontend/hwform.cpp
QTfrontend/model/ammoSchemeModel.cpp
QTfrontend/model/ammoSchemeModel.h
QTfrontend/net/newnetclient.h
--- a/QTfrontend/hwform.cpp	Wed Dec 24 23:26:54 2014 +0300
+++ b/QTfrontend/hwform.cpp	Sat Dec 27 22:09:31 2014 +0300
@@ -1832,7 +1832,7 @@
     if (hwnet)
     {
         NetAmmoSchemeModel * netAmmo = new NetAmmoSchemeModel(hwnet);
-        connect(hwnet, SIGNAL(netSchemeConfig(QStringList &)), netAmmo, SLOT(setNetSchemeConfig(QStringList &)));
+        connect(hwnet, SIGNAL(netSchemeConfig(QStringList)), netAmmo, SLOT(setNetSchemeConfig(QStringList)));
 
         ui.pageNetGame->pGameCFG->GameSchemes->setModel(netAmmo);
 
--- a/QTfrontend/model/ammoSchemeModel.cpp	Wed Dec 24 23:26:54 2014 +0300
+++ b/QTfrontend/model/ammoSchemeModel.cpp	Sat Dec 27 22:09:31 2014 +0300
@@ -845,7 +845,7 @@
     return netScheme[index.column()];
 }
 
-void NetAmmoSchemeModel::setNetSchemeConfig(QStringList & cfg)
+void NetAmmoSchemeModel::setNetSchemeConfig(QStringList cfg)
 {
     if(cfg.size() != netScheme.size())
     {
--- a/QTfrontend/model/ammoSchemeModel.h	Wed Dec 24 23:26:54 2014 +0300
+++ b/QTfrontend/model/ammoSchemeModel.h	Sat Dec 27 22:09:31 2014 +0300
@@ -70,7 +70,7 @@
         QVariant data(const QModelIndex &index, int role) const;
 
     public slots:
-        void setNetSchemeConfig(QStringList & cfg);
+        void setNetSchemeConfig(QStringList cfg);
 
     private:
         QList<QVariant> netScheme;
--- a/QTfrontend/net/newnetclient.h	Wed Dec 24 23:26:54 2014 +0300
+++ b/QTfrontend/net/newnetclient.h	Sat Dec 27 22:09:31 2014 +0300
@@ -111,7 +111,7 @@
         void roomNameUpdated(const QString & name);
         void askForRoomPassword();
 
-        void netSchemeConfig(QStringList &);
+        void netSchemeConfig(QStringList);
         void paramChanged(const QString & param, const QStringList & value);
         void configAsked();