Changeset 690f6939a7 in tspsg for src/tspmodel.cpp
- Timestamp:
- Jul 16, 2009, 6:00:27 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 134a9158bd
- Parents:
- 4c96f94558
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tspmodel.cpp
r4c96f94558 r690f6939a7 276 276 } 277 277 278 voidCTSPModel::saveTask(QString fname)278 bool CTSPModel::saveTask(QString fname) 279 279 { 280 280 QFile f(fname); 281 281 if (!f.open(QIODevice::WriteOnly)) { 282 282 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),QString(trUtf8("Unable to create task file.\nError: %1\nMaybe, file is read-only?")).arg(f.errorString()),QMessageBox::Ok).exec(); 283 return ;283 return false; 284 284 } 285 285 QDataStream ds(&f); … … 288 288 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 289 289 f.close(); 290 return ;290 return false; 291 291 } 292 292 // File signature … … 295 295 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 296 296 f.close(); 297 return ;297 return false; 298 298 } 299 299 // File version … … 302 302 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 303 303 f.close(); 304 return ;304 return false; 305 305 } 306 306 // File metadata version … … 309 309 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 310 310 f.close(); 311 return ;311 return false; 312 312 } 313 313 // Metadata … … 316 316 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 317 317 f.close(); 318 return ;318 return false; 319 319 } 320 320 // Number of cities … … 323 323 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 324 324 f.close(); 325 return ;325 return false; 326 326 } 327 327 // Costs … … 333 333 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 334 334 f.close(); 335 return ;335 return false; 336 336 } 337 337 } 338 338 f.close(); 339 return true; 339 340 } 340 341
Note: See TracChangeset
for help on using the changeset viewer.