Changeset aaf2113307 in tspsg for src/tspmodel.cpp
- Timestamp:
- Aug 3, 2009, 5:15:46 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- f44855d99e
- Parents:
- e96fad3079
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tspmodel.cpp
re96fad3079 raaf2113307 206 206 if (loadError(ds->status())) 207 207 return false; 208 // Cities number208 // Number of cities 209 209 quint16 size; 210 210 *ds >> size; 211 211 if (loadError(ds->status())) 212 212 return false; 213 if ( size < 3) {213 if ((size < 3) || (size > MAX_NUM_CITIES)) { 214 214 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec(); 215 215 return false; 216 216 } 217 if (nCities != size) 217 if (nCities != size) { 218 setNumCities(size); 218 219 emit numCitiesChanged(size); 219 // Costs 220 } 221 // Travel costs 220 222 for (int r = 0; r < size; r++) 221 223 for (int c = 0; c < size; c++) … … 246 248 return false; 247 249 } 248 // Cities number250 // Number of cities 249 251 quint8 size; 250 252 ds->readRawData(reinterpret_cast<char *>(&size),1); … … 255 257 return false; 256 258 } 257 if (nCities != size) 259 if (nCities != size) { 260 setNumCities(size); 258 261 emit numCitiesChanged(size); 259 // Costs 262 } 263 // Travel costs 260 264 double val; 261 265 for (int r = 0; r < 5; r++)
Note: See TracChangeset
for help on using the changeset viewer.