QTfrontend/ammoSchemeModel.cpp
changeset 1889 b8590b604fdd
parent 1887 d68939b3f7f0
child 1890 de5cfe3beb22
--- a/QTfrontend/ammoSchemeModel.cpp	Thu Mar 12 20:29:01 2009 +0000
+++ b/QTfrontend/ammoSchemeModel.cpp	Fri Mar 13 18:04:44 2009 +0000
@@ -25,10 +25,10 @@
 {
 	defaultScheme
 		<< "Default" // name
-		<< "0" // fortsmode
-		<< "0" // team divide
-		<< "0" // solid land
-		<< "0" // border
+		<< "false" // fortsmode
+		<< "false" // team divide
+		<< "false" // solid land
+		<< "false" // border
 		<< "45" // turn time
 		<< "101" // init health
 		<< "15" // sudden death
@@ -85,7 +85,10 @@
 {
 	beginInsertRows(parent, row, row);
 
-	schemes.insert(row, defaultScheme);
+	QStringList newScheme = defaultScheme;
+	newScheme[0] = tr("new");
+	
+	schemes.insert(row, newScheme);
 
 	endInsertRows();
 }
@@ -104,7 +107,8 @@
 	if (!index.isValid() || index.row() < 0
 		|| index.row() >= schemes.size()
 		|| index.column() >= defaultScheme.size()
-		|| role != Qt::DisplayRole)
+		|| (role != Qt::EditRole && role != Qt::DisplayRole)
+		)
 		return QVariant();
 
 	return QVariant::fromValue(schemes[index.row()][index.column()]);