vector removed & teamselwidget moved to constructor
authordisplacer
Sun, 05 Feb 2006 12:48:02 +0000
changeset 60 7fbfa2f13f6f
parent 59 f00aa2cc8b35
child 61 505691a09dee
vector removed & teamselwidget moved to constructor
QTfrontend/hwform.cpp
QTfrontend/hwform.h
--- a/QTfrontend/hwform.cpp	Sat Feb 04 22:37:12 2006 +0000
+++ b/QTfrontend/hwform.cpp	Sun Feb 05 12:48:02 2006 +0000
@@ -44,7 +44,6 @@
 #include "hwform.h"
 #include "sdlkeys.h"
 #include "hwconsts.h"
-#include "teamselect.h"
 
 HWForm::HWForm(QWidget *parent)
 	: QMainWindow(parent)
@@ -123,10 +122,12 @@
 	  list.push_back("DefaultTeam");
 	}
 
+	pts=new TeamSelWidget(ui.Pages->widget(ID_PAGE_SINGLEPLAYER));
+
 	for (QStringList::Iterator it = list.begin(); it != list.end(); ++it )
 	{
 	  QString tmpTeamStr=(*it).replace(QRegExp("^(.*).cfg$"), "\\1");
-	  m_teamNames.push_back(tmpTeamStr);
+	  pts->addTeam(tmpTeamStr);
 	  ui.CBTeamName->addItem(tmpTeamStr);
 	}
 
@@ -195,8 +196,6 @@
 {
 	ui.Pages->setCurrentIndex(ID_PAGE_SINGLEPLAYER);
 
-	TeamSelWidget* pts=new TeamSelWidget(m_teamNames, ui.Pages->widget(ID_PAGE_SINGLEPLAYER));
-
 	pts->resize(500, 350);
 	pts->show();
 }
--- a/QTfrontend/hwform.h	Sat Feb 04 22:37:12 2006 +0000
+++ b/QTfrontend/hwform.h	Sun Feb 05 12:48:02 2006 +0000
@@ -38,15 +38,12 @@
 #include <QLineEdit>
 #include <QDir>
 
-#include <vector>
-
 #include "ui_hwform.h"
 #include "binds.h"
 #include "game.h"
 #include "team.h"
 #include "netclient.h"
-
-using namespace std;
+#include "teamselect.h"
 
 class HWForm : public QMainWindow
 {
@@ -95,7 +92,7 @@
 	HWTeam * tmpTeam;
 	HWNet * hwnet;
 
-	vector<QString> m_teamNames;
+	TeamSelWidget* pts;
 };
 
 #define ID_PAGE_SINGLEPLAYER 0