src/gui_actions.cc

changeset 609
a8dc74a809c6
parent 606
3dd6f343ec06
child 610
f8244301110d
equal deleted inserted replaced
608:487db37f0bb3 609:a8dc74a809c6
386 int idx = getInsertionPoint(); 386 int idx = getInsertionPoint();
387 387
388 if (!fname.length()) 388 if (!fname.length())
389 return; 389 return;
390 390
391 File f (fname, File::Read); 391 QFile f (fname);
392 392
393 if (!f) 393 if (!f.open (QIODevice::ReadOnly))
394 { 394 {
395 critical (fmt ("Couldn't open %1 (%2)", fname, strerror (errno))); 395 critical (fmt ("Couldn't open %1 (%2)", fname, f.errorString()));
396 return; 396 return;
397 } 397 }
398 398
399 QList<LDObject*> objs = loadFileContents (&f, null); 399 QList<LDObject*> objs = loadFileContents (&f, null);
400 400
427 427
428 QFile file (fname); 428 QFile file (fname);
429 429
430 if (!file.open (QIODevice::WriteOnly | QIODevice::Text)) 430 if (!file.open (QIODevice::WriteOnly | QIODevice::Text))
431 { 431 {
432 critical (fmt ("Unable to open %1 for writing (%2)", fname, strerror (errno))); 432 critical (fmt ("Unable to open %1 for writing (%2)", fname, file.errorString()));
433 return; 433 return;
434 } 434 }
435 435
436 for (LDObject* obj : selection()) 436 for (LDObject* obj : selection())
437 { 437 {

mercurial