Ticket #198: mythmusic-idewriter.diff

File mythmusic-idewriter.diff, 1.8 KB (added by directhex@…, 19 years ago)
  • globalsettings.cpp

    old new  
    396396    args = "cdrecord";
    397397    args += "--scanbus";
    398398
     399
     400    //Ask cdrecord for a list of SCSI CD writers
    399401    QProcess proc(args);
    400402
    401403    if (proc.start())
     
    435437            }
    436438        }
    437439    }
     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    }
    438482    gc->setLabel(QObject::tr("CD-Writer Device"));
    439     gc->setHelpText(QObject::tr("Select the SCSI Device for CD Writing.  If "
    440                     "your IDE device is not present, try adding "
    441                     "hdd(or hdc/hdb)=ide-scsi to your boot options"));
     483    gc->setHelpText(QObject::tr("Select the SCSI or IDE Device for CD Writing."));
    442484    return gc;
    443485};
    444486