QTfrontend/ammoSchemeModel.cpp
changeset 3494 208c5671b202
parent 3287 4f7b57ed18b6
child 3743 234ce4da76d4
equal deleted inserted replaced
3493:2adbae321127 3494:208c5671b202
   395     return schemes[index.row()][index.column()];
   395     return schemes[index.row()][index.column()];
   396 }
   396 }
   397 
   397 
   398 void AmmoSchemeModel::Save()
   398 void AmmoSchemeModel::Save()
   399 {
   399 {
   400     fileConfig.beginWriteArray("schemes", schemes.size());
   400     fileConfig.beginWriteArray("schemes", schemes.size() - numberOfDefaultSchemes);
   401 
   401 
   402     for (int i = 0; i < schemes.size(); ++i) {
   402     for (int i = 0; i < schemes.size() - numberOfDefaultSchemes; ++i) {
   403         fileConfig.setArrayIndex(i);
   403         fileConfig.setArrayIndex(i);
   404 
   404 
   405         QList<QVariant> scheme = schemes[i];
   405         QList<QVariant> scheme = schemes[i + numberOfDefaultSchemes];
   406 
   406 
   407         for (int k = 0; k < scheme.size(); ++k)
   407         for (int k = 0; k < scheme.size(); ++k)
   408             fileConfig.setValue(spNames[k], scheme[k]);
   408             fileConfig.setValue(spNames[k], scheme[k]);
   409     }
   409     }
   410     fileConfig.endArray();
   410     fileConfig.endArray();