QTfrontend/ammoSchemeModel.cpp
changeset 4600 5a3b1dbdd4c9
parent 4560 5d6c7f88db73
child 4820 4dcfbf9f7910
--- a/QTfrontend/ammoSchemeModel.cpp	Tue Dec 21 21:56:34 2010 +0100
+++ b/QTfrontend/ammoSchemeModel.cpp	Tue Dec 21 23:22:53 2010 +0100
@@ -628,12 +628,20 @@
 {
     Q_UNUSED(count);
 
-    beginInsertRows(parent, row, row);
+    beginInsertRows(parent, schemes.size(), schemes.size());
 
-    QList<QVariant> newScheme = defaultScheme;
-    newScheme[0] = QVariant(tr("new"));
-
-    schemes.insert(row, newScheme);
+    if (row == -1)
+    {
+        QList<QVariant> newScheme = defaultScheme;
+        newScheme[0] = QVariant(tr("new"));
+        schemes.insert(schemes.size(), newScheme);
+    }
+    else
+    {
+        QList<QVariant> newScheme = schemes[row];
+        newScheme[0] = QVariant(tr("copy of") + " " + newScheme[0].toString());
+        schemes.insert(schemes.size(), newScheme);
+    }
 
     endInsertRows();