| 440 | |
| 441 | // Now do the same again, for IDE CD writers |
| 442 | args += "-dev=ATA"; |
| 443 | QProcess proc2(args); |
| 444 | |
| 445 | if (proc2.start()) |
| 446 | { |
| 447 | while (1) |
| 448 | { |
| 449 | while (proc2.canReadLineStdout()) |
| 450 | result += proc2.readLineStdout(); |
| 451 | if (proc2.isRunning()) |
| 452 | { |
| 453 | qApp->processEvents(); |
| 454 | usleep(10000); |
| 455 | } |
| 456 | else |
| 457 | { |
| 458 | if (!proc2.normalExit()) |
| 459 | cerr << "Failed to run 'cdrecord -dev=ATA --scanbus'\n"; |
| 460 | break; |
| 461 | } |
| 462 | } |
| 463 | } |
| 464 | else |
| 465 | cerr << "Failed to run 'cdrecord --scanbus'\n"; |
| 466 | |
| 467 | while (proc2.canReadLineStdout()) |
| 468 | result += proc2.readLineStdout(); |
| 469 | |
| 470 | for (QStringList::Iterator it = result.begin(); it != result.end(); |
| 471 | ++it) |
| 472 | { |
| 473 | QString line = *it; |
| 474 | if (line.length() > 12) |
| 475 | { |
| 476 | if (line[10] == ')' && line[12] != '*') |
| 477 | { |
| 478 | gc->addSelection(line.mid(24, 16), "ATA:" + line.mid(1, 5)); |
| 479 | } |
| 480 | } |
| 481 | } |